Part Number Hot Search : 
SMBJ40 XXXXXX 00506 AC130 90E9A 0120A HT48R0 40007
Product Description
Full Text Search
 

To Download 68HC05V12 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  hc05v12grs/d rev. 1.0 non-disclosure agreement required 68HC05V12 general release specification december 10, 1996 csic system design group austin, texas f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required general release speci?cation ? motorola, inc., 1996 mc68HC05V12 rev. 1.0 2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification list of sections non-disclosure agreement required general release specification mc68HC05V12 list of sections section 1. general description ......................................21 section 2. memory map ..................................................35 section 3. central processing unit (cpu) .......................45 section 4. interrupts .........................................................51 section 5. resets ..............................................................63 section 6. low-power modes .........................................71 section 7. parallel input/output (i/o) ............................77 section 8. core timer ......................................................83 section 9. 16-bit timer .....................................................89 section 10. serial peripheral interface (spi) ..................97 section 11. pulse width modulators (pwms) ...............109 section 12. eeprom .......................................................117 section 13. a/d converter ............................................123 section 14. byte data link controller-digital (bdlc-d) ...................................................129 section 15. gauge drivers ............................................173 section 16. instruction set .............................................201 section 17. electrical specifications ............................219 section 18. mechanical specifications .......................233 section 19. ordering information .................................235 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required list of sections general release specification mc68HC05V12 rev. 1.0 list of sections f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification table of contents non-disclosure agreement required general release specification mc68HC05V12 table of contents section 1. general description 1.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.4 mcu structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.5 selectable mask options . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.6 functional pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.6.1 v dd and v ssd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 1.6.2 v ssa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 1.6.3 v cca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 1.6.4 v refh and v refl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 1.6.5 osc1 and osc2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 1.6.5.1 crystal oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 1.6.5.2 ceramic resonator oscillator . . . . . . . . . . . . . . . . . . . . .27 1.6.5.3 external clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 1.6.6 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 1.6.7 irq (maskable interrupt request) . . . . . . . . . . . . . . . . . . .28 1.6.8 pa0Cpa6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 1.6.9 pb0Cpb3 (spi pins), pb4/pwma, pb5/pwmb, pb6/tcmp, and pb7/tcap . . . . . . . . . . . . . . . . . . . . . .29 1.6.10 pc0Cpc7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 1.6.11 pd0Cpd4/ad0Cad4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 1.6.12 txp and rxp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 1.6.13 imax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 1.6.14 v pgc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 1.6.15 v gsup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 1.6.16 v ssg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 1.6.17 v gvref . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 1.6.18 maja(b)1+, maja(b)1 - , maja(b)2+, and maja(b)2 - . . .31 1.6.19 mina(b,c,d)1, mina(b,c,d)2+, and mina(b,c,d)2 - . . . .31 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required table of contents general release specification mc68HC05V12 rev. 1.0 table of contents 1.7 power supply pin connections . . . . . . . . . . . . . . . . . . . . . . . .32 1.8 decoupling recommendations. . . . . . . . . . . . . . . . . . . . . . . . .32 section 2. memory map 2.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 2.3 i/o and control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 2.4 ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 2.5 boot rom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 2.6 user rom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 2.7 eeprom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 2.8 miscellaneous register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 section 3. central processing unit (cpu) 3.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 3.3 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 3.3.1 accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 3.3.2 index register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 3.3.3 stack pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 3.3.4 program counter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 3.3.5 condition code register . . . . . . . . . . . . . . . . . . . . . . . . . . .48 3.4 arithmetic/logic unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 section 4. interrupts 4.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 4.3 cpu interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 4.4 reset interrupt sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 4.5 software interrupt (swi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 4.6 hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 4.7 external interrupt (irq) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 4.7.1 irq status and control register. . . . . . . . . . . . . . . . . . . . .58 4.7.2 external interrupt timing . . . . . . . . . . . . . . . . . . . . . . . . . . .60 4.8 16-bit timer interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
table of contents mc68HC05V12 rev. 1.0 general release specification table of contents non-disclosure agreement required 4.9 bdlc interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 4.10 spi interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 4.11 8-bit timer interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 4.12 gauge synchronize interrupt . . . . . . . . . . . . . . . . . . . . . . . . . .62 4.13 stop and wait modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 secton 5. resets 5.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 5.3 external reset ( reset). . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 5.4 internal resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 5.4.1 power-on reset (por). . . . . . . . . . . . . . . . . . . . . . . . . . . .65 5.4.2 computer operating properly reset (copr) . . . . . . . . . . .66 5.4.2.1 resetting the cop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 5.4.2.2 cop during wait mode . . . . . . . . . . . . . . . . . . . . . . . . . .67 5.4.2.3 cop during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . .67 5.4.2.4 cop watchdog timer considerations . . . . . . . . . . . . . . .67 5.4.2.5 cop register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 5.4.3 illegal address reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69 5.4.4 disabled stop instruction reset . . . . . . . . . . . . . . . . . . . .69 5.4.5 low-voltage reset (lvr) . . . . . . . . . . . . . . . . . . . . . . . . . .69 5.4.6 lvr operation in stop and wait modes . . . . . . . . . . . . . . .70 section 6. low-power modes 6.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 6.3 stop instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 6.4 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 6.5 wait instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75 section 7. parallel input/output (i/o) 7.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 7.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 7.3.1 port a data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 7.3.2 port a data direction register . . . . . . . . . . . . . . . . . . . . . .79 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required table of contents general release specification mc68HC05V12 rev. 1.0 table of contents 7.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 7.4.1 port b data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 7.4.2 port b data direction register . . . . . . . . . . . . . . . . . . . . . .80 7.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 7.5.1 port c data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 7.5.2 port c data direction register . . . . . . . . . . . . . . . . . . . . . .81 7.5.3 port c i/o pin interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . .81 7.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82 section 8. core timer 8.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 8.3 core timer status and control register. . . . . . . . . . . . . . . . . .85 8.4 computer operating properly (cop) reset . . . . . . . . . . . . . . .87 8.5 core timer counter register . . . . . . . . . . . . . . . . . . . . . . . . . .88 8.6 core timer during wait mode. . . . . . . . . . . . . . . . . . . . . . . . . .88 9.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 section 9. 16-bit timer 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 9.3 timer counter registers $18 - $19 and $1a - $1b. . . . . . . . . . .90 9.4 output compare register $16 - $17 . . . . . . . . . . . . . . . . . . . . .92 9.5 input capture register $14 - $15. . . . . . . . . . . . . . . . . . . . . . . .92 9.6 16-bit timer control register . . . . . . . . . . . . . . . . . . . . . . . . . .94 9.7 16-bit timer status register (tmrsr) . . . . . . . . . . . . . . . . . .95 9.8 16-bit timer during wait mode . . . . . . . . . . . . . . . . . . . . . . . . .96 9.9 16-bit timer during stop mode. . . . . . . . . . . . . . . . . . . . . . . . .96 section 10. serial peripheral interface (spi) 10.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 10.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 10.4 spi signal description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 10.4.1 slave select (ss/pb0) . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 10.4.2 serial clock (sck/pb1). . . . . . . . . . . . . . . . . . . . . . . . . . .100 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
table of contents mc68HC05V12 rev. 1.0 general release specification table of contents non-disclosure agreement required 10.4.3 master in slave out (miso/pb2) . . . . . . . . . . . . . . . . . . .100 10.4.4 master out slave in (mosi/pb3) . . . . . . . . . . . . . . . . . . .100 10.5 spi functional description . . . . . . . . . . . . . . . . . . . . . . . . . . .101 10.6 spi registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 10.6.1 serial peripheral control register. . . . . . . . . . . . . . . . . . .103 10.6.2 serial peripheral status register . . . . . . . . . . . . . . . . . . .104 10.6.3 serial peripheral data register. . . . . . . . . . . . . . . . . . . . .106 10.7 spi in stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 10.8 spi in wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 section 11. pulse width modulators (pwms) 11.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109 11.3 pwm functional description . . . . . . . . . . . . . . . . . . . . . . . . .110 11.4 pwm registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112 11.4.1 pwma control register . . . . . . . . . . . . . . . . . . . . . . . . . .113 11.4.2 pwmb control register . . . . . . . . . . . . . . . . . . . . . . . . . .114 11.4.3 pwma data register . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 11.4.4 pwmb data register . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 11.5 pwms during wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 11.6 pwms during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 11.7 pwms during reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 section 12. eeprom 12.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 12.3 eeprom programming register . . . . . . . . . . . . . . . . . . . . . .118 12.4 eeprom programming/erasing procedure. . . . . . . . . . . . . .120 12.5 operation in stop and wait modes. . . . . . . . . . . . . . . . . . . . .121 section 13. a/d converter 13.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required table of contents general release specification mc68HC05V12 rev. 1.0 table of contents 13.3 analog section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124 13.3.1 ratiometric conversion . . . . . . . . . . . . . . . . . . . . . . . . . . .124 13.3.2 v refh and v refl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124 13.3.3 accuracy and precision. . . . . . . . . . . . . . . . . . . . . . . . . . .124 13.3.4 conversion process . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124 13.4 digital section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 13.4.1 conversion times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 13.4.2 internal and master oscillators . . . . . . . . . . . . . . . . . . . . .125 13.4.3 multi-channel operation . . . . . . . . . . . . . . . . . . . . . . . . . .126 13.5 a/d status and control register. . . . . . . . . . . . . . . . . . . . . . .126 13.6 a/d data register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 13.7 a/d during wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128 13.8 a/d during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128 section 14. byte data link controller-digital (bdlc-d) 14.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .129 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131 14.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131 14.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132 14.5 bdlc operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133 14.5.1 power off mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134 14.5.2 reset mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134 14.5.3 run mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134 14.5.4 bdlc wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135 14.5.5 bdlc stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135 14.5.6 digital loopback mode . . . . . . . . . . . . . . . . . . . . . . . . . . .135 14.6 bdlc cpu interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135 14.6.1 bdlc control register 1. . . . . . . . . . . . . . . . . . . . . . . . . .136 14.6.2 bdlc control register 2. . . . . . . . . . . . . . . . . . . . . . . . . .138 14.6.3 bdlc state vector register . . . . . . . . . . . . . . . . . . . . . . .144 14.6.4 bdlc data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146 14.6.5 bdlc analog and roundtrip delay. . . . . . . . . . . . . . . . . .147 14.7 bdlc protocol handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150 14.7.1 protocol architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150 14.7.2 rx and tx shift registers . . . . . . . . . . . . . . . . . . . . . . . . .151 14.7.3 rx and tx shadow registers . . . . . . . . . . . . . . . . . . . . . .151 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
table of contents mc68HC05V12 rev. 1.0 general release specification table of contents non-disclosure agreement required 14.7.4 digital loopback multiplexer . . . . . . . . . . . . . . . . . . . . . . .151 14.7.5 state machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151 14.7.5.1 4x mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .152 14.7.5.2 receiving a message in block mode . . . . . . . . . . . . . . .152 14.7.5.3 transmitting a message in block mode . . . . . . . . . . . . .152 14.7.6 j1850 bus errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 14.7.6.1 crc error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 14.7.6.2 symbol error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 14.7.6.3 framing error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 14.7.6.4 bus fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 14.7.6.5 break (break) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154 14.8 bdlc mux interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155 14.8.1 rx digital filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155 14.8.1.1 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156 14.8.1.2 performance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157 14.8.2 j1850 frame format. . . . . . . . . . . . . . . . . . . . . . . . . . . . .158 14.8.3 j1850 vpw symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . . .161 14.8.3.1 logic 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .161 14.8.3.2 logic 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .162 14.8.3.3 normalization bit (nb) . . . . . . . . . . . . . . . . . . . . . . . . . .163 14.8.3.4 start of frame symbol (sof) . . . . . . . . . . . . . . . . . . . .163 14.8.4 eod - end of data symbol. . . . . . . . . . . . . . . . . . . . . . . .163 14.8.4.1 end of frame symbol (eof) . . . . . . . . . . . . . . . . . . . . .163 14.8.4.2 inter-frame separation symbol (ifs) . . . . . . . . . . . . . .163 14.8.4.3 break signal (break) . . . . . . . . . . . . . . . . . . . . . . . . . .163 14.8.5 j1850 vpw valid/invalid bits and symbols . . . . . . . . . . .164 14.8.5.1 invalid passive bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . .165 14.8.5.2 valid passive logic 0 . . . . . . . . . . . . . . . . . . . . . . . . . . .165 14.8.5.3 valid passive logic 1 . . . . . . . . . . . . . . . . . . . . . . . . . . .166 14.8.5.4 valid eod symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . .166 14.8.5.5 valid eof and ifs symbol . . . . . . . . . . . . . . . . . . . . . .167 14.8.5.6 idle bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .167 14.8.5.7 invalid active bit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .168 14.8.5.8 valid active logic 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . .168 14.8.5.9 valid active logic 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . .168 14.8.5.10 valid sof symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . .168 14.8.5.11 valid break symbol . . . . . . . . . . . . . . . . . . . . . . . . . . .169 14.8.6 message arbitration . . . . . . . . . . . . . . . . . . . . . . . . . . . . .169 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required table of contents general release specification mc68HC05V12 rev. 1.0 table of contents 14.9 bdlc application notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171 14.9.1 initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171 14.9.2 bdlc stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171 14.9.3 bdlc wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .172 section 15. gauge drivers 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174 15.3 gauge system overview . . . . . . . . . . . . . . . . . . . . . . . . . . . .174 15.4 coil drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .176 15.5 technical note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .178 15.6 gauge driver control registers . . . . . . . . . . . . . . . . . . . . . . .179 15.6.1 gauge enable register . . . . . . . . . . . . . . . . . . . . . . . . . . .179 15.6.2 current magnitude registers . . . . . . . . . . . . . . . . . . . . . .181 15.6.3 current direction registers . . . . . . . . . . . . . . . . . . . . . . . .183 15.6.3.1 current direction register for major a . . . . . . . . . . . . . .183 15.6.3.2 current direction register for major b . . . . . . . . . . . . . .184 15.6.3.3 current direction register for minor a . . . . . . . . . . . . . .184 15.6.3.4 current direction register for minor b . . . . . . . . . . . . . .185 15.6.3.5 current direction register for minor c. . . . . . . . . . . . . .185 15.6.3.6 current direction register for minor d. . . . . . . . . . . . . .186 15.7 coil sequencer and control . . . . . . . . . . . . . . . . . . . . . . . . . .186 15.7.1 scanning sequence description . . . . . . . . . . . . . . . . . . . .186 15.7.1.1 automatic mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187 15.7.1.2 manual mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187 15.7.2 scan status and control register . . . . . . . . . . . . . . . . . . .189 15.8 mechanism diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .192 15.9 gauge power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .192 15.10 gauge regulator accuracy. . . . . . . . . . . . . . . . . . . . . . . . . . .194 15.11 coil current accuracy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .194 15.12 external component considerations . . . . . . . . . . . . . . . . . . .195 15.12.1 minimum voltage operation . . . . . . . . . . . . . . . . . . . . . . .196 15.12.2 power dissipation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .197 15.12.3 coil inductance limits . . . . . . . . . . . . . . . . . . . . . . . . . . . .198 15.13 operation in wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . .198 15.14 operation in stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . .199 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
table of contents mc68HC05V12 rev. 1.0 general release specification table of contents non-disclosure agreement required section 16. instruction set 16.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .201 16.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .202 16.3 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .202 16.3.1 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203 16.3.2 immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203 16.3.3 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203 16.3.4 extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203 16.3.5 indexed, no offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204 16.3.6 indexed, 8-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204 16.3.7 indexed,16-bit offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . .204 16.3.8 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205 16.4 instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205 16.4.1 register/memory instructions . . . . . . . . . . . . . . . . . . . . . .206 16.4.2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . .207 16.4.3 jump/branch instructions . . . . . . . . . . . . . . . . . . . . . . . . .208 16.4.4 bit manipulation instructions . . . . . . . . . . . . . . . . . . . . . . .210 16.4.5 control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .211 16.5 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .212 secton 17. electrical specifications 17.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219 17.2 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .220 17.3 operating temperature range. . . . . . . . . . . . . . . . . . . . . . . .221 17.4 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221 17.5 power considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .222 17.6 dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . .223 17.7 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .224 17.8 a/d converter characteristics . . . . . . . . . . . . . . . . . . . . . . . .226 17.9 lvr timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .227 17.10 serial peripheral interface (spi) timing . . . . . . . . . . . . . . . . .228 17.11 gauge driver electricals . . . . . . . . . . . . . . . . . . . . . . . . . . . . .230 17.12 bdlc electricals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .231 17.12.1 transmitter vpw symbol timings . . . . . . . . . . . . . . . . . .231 17.12.2 receiver vpw symbol timings . . . . . . . . . . . . . . . . . . . .231 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required table of contents general release specification mc68HC05V12 rev. 1.0 table of contents section 18. mechanical specifications 18.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .233 18.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .233 18.3 68-lead plastic leaded chip carrier (plcc). . . . . . . . . . . . .234 section 19. ordering information 19.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235 19.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235 19.3 mcu ordering forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235 19.4 application program media. . . . . . . . . . . . . . . . . . . . . . . . . . .236 19.5 rom program verification . . . . . . . . . . . . . . . . . . . . . . . . . . .237 19.6 rom verification units (rvus). . . . . . . . . . . . . . . . . . . . . . . .238 19.7 mc order number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .238 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification list of figures non-disclosure agreement required general release specification mc68HC05V12 list of figures figure title page 1-1 mc68HC05V12 block diagram . . . . . . . . . . . . . . . . . . . . . .24 1-2 mc68HC05V12 pin assignments (68-pin plcc package) .25 1-3 oscillator connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 1-4 supply decoupling diagram. . . . . . . . . . . . . . . . . . . . . . . . .32 1-5 single-sided pcb example . . . . . . . . . . . . . . . . . . . . . . . . .33 2-1 mc68HC05V12 single-chip mode memory map. . . . . . . . .36 2-2 mc68HC05V12 i/o registers memory map . . . . . . . . . . . .37 2-3 i/o registers $0000C$000f . . . . . . . . . . . . . . . . . . . . . . . . .39 2-4 i/o registers $0010C$001f . . . . . . . . . . . . . . . . . . . . . . . . .40 2-5 i/o registers $0020C$002f . . . . . . . . . . . . . . . . . . . . . . . . .41 2-6 i/o registers $0030C$003f . . . . . . . . . . . . . . . . . . . . . . . . .42 2-7 miscellaneous register (misc) . . . . . . . . . . . . . . . . . . . . . .43 3-1 programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 3-2 accumulator (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 3-3 index register (x) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 3-4 stack pointer (sp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 3-5 program counter (pc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 3-6 condition code register (ccr) . . . . . . . . . . . . . . . . . . . . . .48 4-1 interrupt processing flowchart. . . . . . . . . . . . . . . . . . . . . . .54 4-2 irq function block diagram . . . . . . . . . . . . . . . . . . . . . . . .56 4-3 irq status and control register (iscr) . . . . . . . . . . . . . . .58 4-4 external interrupts timing diagram . . . . . . . . . . . . . . . . . . .60 5-1 reset block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 5-2 reset and por timing diagram . . . . . . . . . . . . . . . . . . . .66 5-3 cop watchdog timer location . . . . . . . . . . . . . . . . . . . . . .68 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required list of figures general release specification mc68HC05V12 rev. 1.0 list of figures figure title page 6-1 stop recovery timing diagram . . . . . . . . . . . . . . . . . . . . . .73 6-2 stop/wait flowcharts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74 7-1 port a i/o circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 7-2 port b i/o circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 7-3 port c i/o circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 7-4 port d circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82 8-1 core timer block diagram . . . . . . . . . . . . . . . . . . . . . . . . . .84 8-2 core timer status and control register (ctscr) . . . . . . .85 8-3 core timer counter register (ctcr) . . . . . . . . . . . . . . . . .88 9-1 16-bit timer block diagram . . . . . . . . . . . . . . . . . . . . . . . . .90 9-2 tcap timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 9-3 timer control register (tmrcr) . . . . . . . . . . . . . . . . . . . . .94 9-4 timer status register (tmrsr) . . . . . . . . . . . . . . . . . . . . .95 10-1 data clock timing diagram . . . . . . . . . . . . . . . . . . . . . . . . .99 10-2 serial peripheral interface block diagram . . . . . . . . . . . . .102 10-3 serial peripheral interface master-slave interconnection .102 10-4 spi control register (spcr) . . . . . . . . . . . . . . . . . . . . . . .103 10-5 spi status register (spsr). . . . . . . . . . . . . . . . . . . . . . . .104 10-6 spi data register (spdr) . . . . . . . . . . . . . . . . . . . . . . . . .106 11-1 pwm block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110 11-2 pwm waveform examples (pol = 1) . . . . . . . . . . . . . . . .111 11-3 pwm waveform examples (pol = 0) . . . . . . . . . . . . . . . .111 11-4 pwm write sequences . . . . . . . . . . . . . . . . . . . . . . . . . . .112 11-5 pwma control register (pwmac) . . . . . . . . . . . . . . . . . .113 11-6 pwmb control register (pwmbc) . . . . . . . . . . . . . . . . . .114 11-7 pwma data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 11-8 pwmb data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 12-1 eeprom programming register (eeprog) . . . . . . . . . .118 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
list of figures mc68HC05V12 rev. 1.0 general release specification list of figures non-disclosure agreement required figure title page 13-1 a/d status and control register (adscr) . . . . . . . . . . . .126 13-2 a/d data register (addr) . . . . . . . . . . . . . . . . . . . . . . . . .127 14-1 bdlc block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132 14-2 bdlc operating modes state diagram . . . . . . . . . . . . . . .133 14-3 bdlc control register 1 (bcr1) . . . . . . . . . . . . . . . . . . . .136 14-4 bdlc control register 2 (bcr2) . . . . . . . . . . . . . . . . . . . .138 14-5 types of in-frame response. . . . . . . . . . . . . . . . . . . . . . .141 14-6 bdlc state vector register (bsvr) . . . . . . . . . . . . . . . . .145 14-7 bdlc data register (bdr) . . . . . . . . . . . . . . . . . . . . . . . .147 14-8 bdlc analog roundtrip delay register (bard) . . . . . . . .148 14-9 bdlc protocol handler outline . . . . . . . . . . . . . . . . . . . . .150 14-10 bdlc rx digital filter block diagram . . . . . . . . . . . . . . . .156 14-11 j1850 bus message format (vpw) . . . . . . . . . . . . . . . . . .158 14-12 j1850 vpw symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . .162 14-13 j1850 vpw passive symbols . . . . . . . . . . . . . . . . . . . . . .165 14-14 j1850 vpw eof and ifs symbols . . . . . . . . . . . . . . . . . .166 14-15 j1850 vpw active symbols. . . . . . . . . . . . . . . . . . . . . . . .167 14-16 j1850 vpw break symbol . . . . . . . . . . . . . . . . . . . . . . .168 14-17 j1850 vpw bitwise arbitrations . . . . . . . . . . . . . . . . . . . . .170 15-1 gauge driver block diagram . . . . . . . . . . . . . . . . . . . . . . .175 15-2 full h-bridge coil driver. . . . . . . . . . . . . . . . . . . . . . . . . . .177 15-3 half h-bridge coil driver . . . . . . . . . . . . . . . . . . . . . . . . . .177 15-4 specification for current spikes . . . . . . . . . . . . . . . . . . . . .178 15-5 gauge enable register (ger). . . . . . . . . . . . . . . . . . . . . .180 15-6 current magnitude registers . . . . . . . . . . . . . . . . . . . . . . .181 15-7 maja current direction register (dmaja) . . . . . . . . . . . .183 15-8 majb current direction register (dmajb) . . . . . . . . . . . .184 15-9 mina current direction register (dmina) . . . . . . . . . . . . .184 15-10 minb current direction register (dminb) . . . . . . . . . . . . .185 15-11 minc current direction register (dminc) . . . . . . . . . . . .185 15-12 mind current direction register (dmind) . . . . . . . . . . . .186 15-13 scan status and control register (sscr). . . . . . . . . . . . .190 15-14 sample gauge connections to the mc68HC05V12 . . . . .193 15-15 coil driver current path . . . . . . . . . . . . . . . . . . . . . . . . . . .195 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required list of figures general release specification mc68HC05V12 rev. 1.0 list of figures figure title page 17-1 stop recovery timing diagram . . . . . . . . . . . . . . . . . . . . .225 17-2 lvr timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . .227 17-3 spi slave timing (cpha = 0) . . . . . . . . . . . . . . . . . . . . . .229 17-4 spi slave timing (cpha = 1) . . . . . . . . . . . . . . . . . . . . . .229 17-5 bdlc variable pulse width modulation (vpw) symbol timings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .232 18-1 68-lead plcc, case 779-02 . . . . . . . . . . . . . . . . . . . . . . .234 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification list of tables non-disclosure agreement required general release specification mc68HC05V12 list of tables table title page 4-1 vector address for interrupts and reset . . . . . . . . . . . . . . . .53 5-1 cop watchdog timer recommendations . . . . . . . . . . . . . . .68 8-1 rti and cop rates at 2.1 mhz . . . . . . . . . . . . . . . . . . . . . . .86 10-1 serial peripheral rate selection. . . . . . . . . . . . . . . . . . . . . .104 11-1 pwma clock rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113 11-2 pwmb clock rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114 12-1 erase mode select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119 12-2 eeprom write/erase cycle reduction . . . . . . . . . . . . . . . .120 13-1 a/d channel assignments . . . . . . . . . . . . . . . . . . . . . . . . . .127 14-1 bdlc rate selection for binary frequencies . . . . . . . . . . .137 14-2 bdlc rate selection for integer frequencies . . . . . . . . . . .137 14-3 transmit in-frame response control bit priority encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140 14-4 interrupt sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145 14-5 bard offset delays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149 14-6 bdlc j1850 bus error summary. . . . . . . . . . . . . . . . . . . . .155 15-1 coil scanning sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . .188 15-2 gauge module clock select bits . . . . . . . . . . . . . . . . . . . . .191 16-1 register/memory instructions. . . . . . . . . . . . . . . . . . . . . . . .206 16-2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . . .207 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required list of tables general release specification mc68HC05V12 rev. 1.0 list of tables table title page 16-3 jump and branch instructions . . . . . . . . . . . . . . . . . . . . . . .209 16-4 bit manipulation instructions. . . . . . . . . . . . . . . . . . . . . . . . .210 16-5 control instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .211 16-6 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . .212 16-7 opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .218 17-1 bdlc transmitter vpw symbol timings (bard bits bo[3:0] = 0111) . . . . . . . . . . . . . . . . . . . . . .231 17-2 bdlc receiver vpw symbol timings (bard bits bo[3:0] = 0111) . . . . . . . . . . . . . . . . . . . . . .231 19-1 mc order number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .238 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification general description non-disclosure agreement required general release specification mc68HC05V12 section 1. general description 1.1 contents 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.4 mcu structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.5 selectable mask options . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.6 functional pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . .25 1.6.1 v dd and v ssd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 1.6.2 v ssa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 1.6.3 v cca . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 1.6.4 v refh and v refl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 1.6.5 osc1 and osc2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 1.6.5.1 crystal oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 1.6.5.2 ceramic resonator oscillator . . . . . . . . . . . . . . . . . . . . .27 1.6.5.3 external clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 1.6.6 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 1.6.7 irq (maskable interrupt request) . . . . . . . . . . . . . . . . . . .28 1.6.8 pa0Cpa6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 1.6.9 pb0Cpb3 (spi pins), pb4/pwma, pb5/pwmb, pb6/tcmp, and pb7/tcap . . . . . . . . . . . . . . . . . . . . . .29 1.6.10 pc0Cpc7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 1.6.11 pd0Cpd4/ad0Cad4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 1.6.12 txp and rxp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 1.6.13 imax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 1.6.14 v pgc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 1.6.15 v gsup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 1.6.16 v ssg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 1.6.17 v gvref . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 1.6.18 maja(b)1+, maja(b)1 - , maja(b)2+, and maja(b)2 - . . .31 1.6.19 mina(b,c,d)1, mina(b,c,d)2+, and mina(b,c,d)2 - . . . .31 1.7 power supply pin connections . . . . . . . . . . . . . . . . . . . . . . . .32 1.8 decoupling recommendations. . . . . . . . . . . . . . . . . . . . . . . . .32 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required general description general release specification mc68HC05V12 rev. 1.0 general description 1.2 introduction the motorola mc68HC05V12 microcontroller is a custom m68hc05- based mcu featuring a byte data link controller (bdlc) module and on- chip power regulation for the on-chip gauge drivers. the device is available packaged in a 68-pin plastic lead chip carrier (plcc). a functional block diagram of the mc68HC05V12 is shown in figure 1-1 . 1.3 features features of the mc68HC05V12 include the following. ? m68hc05 core with on-chip oscillator for crystal/ceramic resonator ? 12 kbytes of user rom and 384 bytes of user ram ? 256 bytes of byte, block, or bulk erasable eeprom ? byte data link controller (bdlc) module ? 5-channel, 8-bit analog-to-digital (a/d) converter ? serial peripheral interface (spi) ? 8-bit timer with real-time interrupt ? 16-bit timer with one input capture and one output compare ? two 38-frequency, 6-bit pulse width modulators (pwms) ? mask option selectable computer operating properly (cop) watchdog system ? 23 general-purpose input/output (i/o) pins: C eight i/o pins with interrupt wakeup capability C eight i/o pins multiplexed with timer, pwms, and serial peripheral interface (spi) pins C seven general-purpose i/o pins ? five input-only pins multiplexed with a/d f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
general description mcu structure mc68HC05V12 rev. 1.0 general release specification general description non-disclosure agreement required ? on-chip h-bridge driver circuitry to drive six gauges C four minor gauges C two major gauges ? mask option selectable low-voltage reset (lvr) ? power-saving stop mode and wait mode instructions (mask option selectable stop instruction disable) 1.4 mcu structure the overall block diagram of the mc68HC05V12 is shown in figure 1-1 . note: a line over a signal name indicates an active low signal. for example, reset is active high and reset is active low. any reference to voltage, current, or frequency specified in the following sections will refer to the nominal values. the exact values and their tolerance or limits are specified in section 17. electrical specifications . 1.5 selectable mask options the following mask options are selectable. ? sensitivity on irq interrupt, edge- and level-sensitive or edge- sensitive only ? selectable cop watchdog system enable/disable ? selectable low-voltage reset (lvr) to hold cpu in reset ? selectable stop instruction disable f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required general description general release specification mc68HC05V12 rev. 1.0 general description figure 1-1. mc68HC05V12 block diagram index register oscillator reset osc 1 osc 2 sram 384 bytes user rom 12 kbytes irq ? 2 pa0 pa1 pa3 pa3 pa4 pa5 pa6 data direction reg port a v ssd eeprom 256 bytes 16-bit timer with 1 tcap and 1 tcmp pb7/tcap pb1/sck pb2/mosi pb3/miso pb4/pwma pb5/pwmb pb6/tcmp data direction reg port b pc7 * pc0 * pc1 * pc2 * pc3 * pc4 * pc5 * pc6 * data direction reg port c gauge drivers v dd lv r 2-channel 38-frequency, 6-bit pwm spi 5-channel, 8-bit a/d converter pd0/ad0 pd1/ad1 pd2/ad2 pd3/ad3 pd4/ad4 bdlc rxp v ssa interrupt v cca v pgc clkin 8-bit timer with rti v dd v gvref v gsup v ssg maj/min gauge pins (20 pins) internal data/address bus v refh v refl txp i max * interrupt pins v dd internal stack ptr cond code reg 1 1 1 i n z c h cpu control 0 0 0 1 1 0 0 0 0 0 alu 68hc05 cpu accumlator program counter cpu registers pb0/ss watchdog v ssd internal digital supplies v ssg f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
general description functional pin descriptions mc68HC05V12 rev. 1.0 general release specification general description non-disclosure agreement required 1.6 functional pin descriptions the pinout for the mc68HC05V12 is shown in figure 1-2 followed by a functional description of each pin. figure 1-2. mc68HC05V12 pin assignments (68-pin plcc package) 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 9 10 11 8 7 6 5 4 3 2 1 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 10 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 29 30 28 27 pb0/ ss pb1/sck pb2/mosi pb3/miso pb4/pwma pb5/pwmb pb6/tcmp pb7/tcap txp rxp v dd v ssd i max minb1 minb2+ minb2- v ssg pc3 pc2 pc1 pc0 v refh v refl pd4/ad4 pd3/ad3 pd2/ad2 pd1/ad1 pd0/ad0 v cca v ssa mind1 mind2+ mind2- v ssg mina1 mina2+ mina2- maja1+ maja1- maja2+ maja2- v pgc v gsup v gref majb1+ majb1- majb2+ majb2- minc1 minc2+ minc2- irq v ssd v dd osc1 osc2 reset pa6 pa5 pa4 pa3 pa2 pa1 pa0 pc7 pc6 pc5 pc4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required general description general release specification mc68HC05V12 rev. 1.0 general description 1.6.1 v dd and v ssd these pins provide power to all the microcontrollers digital circuits. the short rise and fall times of the mcu supply current transients place very high short-duration current demands on the internal power supply. to prevent noise problems, special care should be taken to provide good power supply bypassing at the mcu by using bypass capacitors with good high-frequency characteristics that are positioned as close to the mcu supply pins as possible. two sets of v dd and v ss pins are required to maintain on-chip supply noise within acceptable limits. each supply pin pair will require its own decoupling capacitor. these are high-current pins. 1.6.2 v ssa v ssa is a separate ground pad which provides a ground return for the analog-to-digital (a/d) subsystem and the digital-to-analog (d/a) gauge subsystem. to prevent digital noise contamination, this pin should be connected directly to a low-impedance ground reference point. 1.6.3 v cca v cca is a separate supply pin providing power to the analog subsystems of the a/d converter and gauge drivers. this pin must be connected to the v dd pin externally. to prevent contamination from the digital supply, this pin should be adequately decoupled to a low-impedance ground reference. 1.6.4 v refh and v refl v refh is the positive (high) reference voltage for the a/d subsystem. v refl is the negative (low) reference voltage for the a/d subsystem. v refh and v refl should be isolated from the digital supplies to prevent any loss of accuracy from the a/d converter. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
general description functional pin descriptions mc68HC05V12 rev. 1.0 general release specification general description non-disclosure agreement required 1.6.5 osc1 and osc2 the osc1 and osc2 pins are the connections for the on-chip oscillator. osc1 is the input to the oscillator inverter. the output (osc2) will always reflect osc1 inverted except when the device is in stop mode which forces osc2 high. the osc1 and ocs2 pins can accept the following sets of components: 1. a crystal as shown in figure 1-3 (a) 2. a ceramic resonator as shown in figure 1-3 (a) 3. an external clock signal as shown in figure 1-3 (b) the frequency, f osc , of the oscillator or external clock source is divided by two to produce the internal operating frequency, f op . 1.6.5.1 crystal oscillator the circuit in figure 1-3 (a) shows a typical oscillator circuit for an at- cut, parallel resonant crystal. the crystal manufacturers recommendations should be followed, as the crystal parameters determine the external component values required to provide maximum stability and reliable startup. the load capacitance values used in the oscillator circuit design should include all stray capacitances. the crystal and components should be mounted as close as possible to the pins for startup stabilization and to minimize output distortion and radiated emissions. 1.6.5.2 ceramic resonator oscillator in cost-sensitive applications, a ceramic resonator can be used in place of the crystal. the circuit in figure 1-3 (a) can be used for a ceramic resonator. the resonator manufacturers recommendations should be followed, as the resonator parameters determine the external component values required for maximum stability and reliable starting. the load capacitance values used in the oscillator circuit design should include all stray capacitances. the ceramic resonator and components should be mounted as close as possible to the pins for startup stabilization and to minimize output distortion and radiated emissions. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required general description general release specification mc68HC05V12 rev. 1.0 general description 1.6.5.3 external clock an external clock from another cmos-compatible device can be connected to the osc1 input. the osc2 pin should be left unconnected, as shown in figure 1-3 (b). figure 1-3. oscillator connections 1.6.6 reset this pin can be used as an input to reset the mcu to a known startup state by pulling it to the low state. the reset pin contains an internal schmitt trigger to improve its noise immunity as an input. the reset pin has an internal pulldown device that pulls the reset pin low when there is an internal computer operating properly (cop) watchdog reset, power-on reset (por), illegal address reset, a disabled stop instruction reset or an internal low-voltage reset. refer to section 5. resets . 1.6.7 irq (maskable interrupt request) this input pin drives the asynchronous irq interrupt function of the cpu. the irq interrupt function has a programmable mask option to select either negative edge-sensitive triggering or both negative edge- sensitive and low level-sensitive triggering. the irq input requires an external resistor to v dd for wire-or operation, if desired. if the irq pin is not used, it must be tied to the v dd supply. the irq pin contains an (a) crystal or ceramic resonator connections unconnected external clock (b) external clock source connection osc1 osc2 mcu 20 pf * 20 pf * 4 mhz* 10 m w * *values shown are typical. for further information, consult the crystal oscillator vendor. mcu osc1 osc2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
general description functional pin descriptions mc68HC05V12 rev. 1.0 general release specification general description non-disclosure agreement required internal schmitt trigger as part of its input to improve noise immunity. each of the pc0 through pc7 i/o pins may be connected as an or function with the irq interrupt function. this capability allows keyboard scan applications where the transitions on the i/o pins will behave the same as the irq pin. the edge or level sensitivity selected by a mask option for the irq pin does not apply to the port c input/output (i/o) pin interrupt. the i/o pin interrupt is always negative edge-sensitive. see section 4. interrupts for more details on the interrupts. 1.6.8 pa0Cpa6 these seven i/o lines comprise port a. the state of any pin is software programmable, and all port a lines are configured as inputs during power-on or reset. see section 7. parallel input/output (i/o) for more details on the i/o ports. 1.6.9 pb0Cpb3 (spi pins), pb4/pwma, pb5/pwmb, pb6/tcmp, and pb7/tcap these eight i/o lines comprise port b. the state of any pin is software programmable, and all port b lines are configured as inputs during power-on or reset. see section 7. parallel input/output (i/o) for more details on the i/o ports. pb0Cpb3 are shared with serial peripheral interface (spi) functions. see section 10. serial peripheral interface (spi) for more details concerning the operation of the spi and configuration of these pins. pb6 and pb7 are also shared with timer functions. the tcap pin controls the input capture feature for the on-chip 16-bit timer. the tcmp pin provides an output for the output compare feature of the on-chip 16- bit timer. see section 9. 16-bit timer for more details on the operation of the timer subsystem. pb4 and pb5 are shared with the pulse width modulator output pins (pwma and pwmb). see section 11. pulse width modulators (pwms) for more details on the operation of the pwms. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required general description general release specification mc68HC05V12 rev. 1.0 general description 1.6.10 pc0Cpc7 these eight i/o lines comprise port c. the state of any pin is software programmable and all port c lines are configured as inputs during power-on or reset. all eight pins are connected via an internal gate to the irq interrupt function. when the irq interrupt function is enabled, all the port c pins will act as negative edge-sensitive irq sources. see section 7. parallel input/output (i/o) for more details on the i/o ports. 1.6.11 pd0Cpd4/ad0Cad4 when the a/d converter is disabled, pd0Cpd4 are general-purpose input pins. the a/d converter is disabled upon exiting from reset. when the a/d converter is enabled, one of these pins is the analog input to the a/d converter. the a/d control register contains control bits to direct which of the analog inputs are to be converted at any one time. a digital read of this pin when the a/d converter is enabled results in a read of logical zero from the selected analog pin. a digital read of the remaining pins gives their correct (digital) values. see section 13. a/d converter for more details on the operation of the a/d subsystem. 1.6.12 txp and rxp these pins provide the i/o interface for the bdlc subsystem. see section 14. byte data link controller-digital (bdlc-d) for more details on the operation of the bdlc. 1.6.13 i max this pin is used to define the maximum coil current in the gauges by connecting a resistor from this pin (r max ) to ground as shown in 15.7 coil sequencer and control . 1.6.14 v pgc this pin is the gauge power control pin for the external pass device. refer to 15.7 coil sequencer and control . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
general description functional pin descriptions mc68HC05V12 rev. 1.0 general release specification general description non-disclosure agreement required 1.6.15 v gsup this pin is the regulated gauge voltage input. refer to 15.7 coil sequencer and control . 1.6.16 v ssg two pins are provided for a separate gauge driver ground, v ssg . used as the current return only for the coil driver circuitry, it is a high-current pin. 1.6.17 v gvref this pin is the feedback pin for the gauge power regulator. external resistors as shown in figure 15-14 . sample gauge connections to the mc68HC05V12 are used to set the gauge input voltage at pin v gsup . 1.6.18 maja(b)1+, maja(b)1 - , maja(b)2+, and maja(b)2 - these pins are the full h-bridge coil driver pins. the a or b refer to pins associated with major gauge a or gauge b, and pin 1+/ - or pin 2+/ - refer to coil 1 or coil 2 of that major gauge and the direction of current flow. refer to 15.3 gauge system overview for more details on the operation of these pins. 1.6.19 mina(b,c,d)1, mina(b,c,d)2+, and mina(b,c,d)2 - mina(b,c,d)2+ and mina(b,c,d)2 - are the full h-bridge driver pins used with or for the minor gauges. these pins allow the coil current to be reversed for movement of gauge pointer from 0 to 180 degrees. mina(b,c,d)1 is the low-side driver pin used with the minor gauges. the current flow through the coil is restricted to one direction. refer to 15.3 gauge system overview for more details on the operation of these pins. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required general description general release specification mc68HC05V12 rev. 1.0 general description 1.7 power supply pin connections refer to figure 1-4 for a supply decoupling diagram. figure 1-4. supply decoupling diagram 1.8 decoupling recommendations to provide effective decoupling and to reduce radiated rf emissions, small decoupling capacitors must be located as close to the supply pins as possible. the self-inductance of these capacitors and the parasitic inductance and capacitance of the interconnecting traces determine the self-resonant frequency of the decoupling network. a frequency that is too low will reduce decoupling effectiveness and could increase radiated rf emissions from the system. a low value capacitor (470 pf to 0.01 m f) placed in parallel with the other capacitors will improve the bandwidth and effectiveness of the network. v dd v ssd 0.1 m f v ssa v cca a/d converter 0.1 m f single point ground digital gauge register gauge drivers digital circuit supply digital circuit ground v gsup* analog ground analog supply modules ** v dd v ssd 0.1 m f v pgc* v ssg 0.1 m f * refer to section 15. gauge drivers for decoupling recommendations. **optional supply isolation circuit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
general description decoupling recommendations mc68HC05V12 rev. 1.0 general release specification general description non-disclosure agreement required 1. v dd to v ssd : mcu internal digital power decoupling. decouple with a 0.1 m f ceramic or polystyrene cap. if the self-resonance frequency of the decoupling circuit (assume 4 nh per bond wire) is too low, add a 0.01 m f or smaller cap in parallel to increase the bandwidth of the decoupling network. place the smaller cap closest to the v dd and v ssd pins. 2. v cca to v ssa : analog subsystem power supply pins. these pins are internally isolated from the digital v dd and v ss supplies. the v ssa pin provides a ground return for the a/d subsystem and portions of the gauge subsystem. the analog supply pins should be appropriately filtered to prevent any external noise affecting the analog subsystems. the v ssa pin should be brought together with the digital ground at a single point which has a low (hf) impedance to ground to prevent common mode noise problems. if this is not practical, then the v ssa pcb traces should be routed in such a manner that digital ground return current is impeded from passing through the analog input ground reference as shown in figure 1-5 . figure 1-5. single-sided pcb example v ssd v12 v ssa anx to system gnd ain v ssd v12 v ssa anx agnd ain gnd shielded gnd shielded cable poor analog grounding better analog grounding cable f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required general description general release specification mc68HC05V12 rev. 1.0 general description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification memory map non-disclosure agreement required general release specification mc68HC05V12 section 2. memory map 2.1 contents 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 2.3 i/o and control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 2.4 ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 2.5 boot rom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 2.6 rom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 2.7 eeprom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 2.8 miscellaneous register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 2.2 introduction when the mc68HC05V12 is in the single-chip mode, the input/out (i/o) and peripherals, user ram, eeprom, and user rom are all active as shown in figure 2-1 . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required memory map general release specification mc68HC05V12 rev. 1.0 memory map figure 2-1 . mc68HC05V12 single-chip mode memory map 2.3 i/o and control registers the i/o and control registers reside in locations $0000C$003f. the overall organization of these registers is shown in figure 2-2 . the bit assignments for each register are shown in figure 2-3 through figure 2-6 . reading from unimplemented bits will return unknown states, and writing to unimplemented bits will be ignored. bootloader/ factory test code rom 1008 bytes user vectors rom 16 bytes 0832 0831 16383 16368 16367 stack ram 64 bytes user ram 192 bytes reset vector (low byte) reset vector (high byte) swi vector (low byte) swi vector (high byte) irq vector (low byte) irq vector (high byte) 16-bit timer vector (low byte) 16-bit timer vector (high byte) $3ff7 $3ff8 $3ff9 $3ffa $3ffb $3ffc $3ffd $3ffe $3fff bdlc vector (low byte) $003f $0000 $0100 $00ff 0255 0256 i/o 64 bytes 0064 0063 0000 $3fff $3ff0 $3fef $0040 $003f $0000 user rom 12032 bytes i/o registers 64 bytes see figure 2-2 $3ff6 bdlc vector (high byte) $3ff3 8-bit timer vector (low byte) $3ff4 spi vector (high byte) $3ff5 spi vector (low byte) $3ff2 8-bit timer vector (high byte) $3ff1 gauge vector (low byte) $3ff0 *gauge vector (high byte)/ 15360 15359 $3c00 $3bff $0d00 $0cff user eeprom 256 bytes 3328 3327 unused 2496 bytes $0340 $033f $0240 $01bf 0447 0576 user ram 128 bytes unused cop watchdog timer *reading $3ff0 returns the gauge vector eprom byte. writing a zero to $3ff0, bit 0, resets the cop. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
memory map i/o and control registers mc68HC05V12 rev. 1.0 general release specification memory map non-disclosure agreement required figure 2-2. mc68HC05V12 i/o registers memory map port a data register port b data register port a data direction register port b data direction register 16-bit timer status register eeprom program register a/d data register a/d status and control register $0000 port c data register port c data direction register alternate count register (low) alternate count register (high) 16-bit timer count register (low) 16-bit timer count register (high) output compare register (low) output compare register (high) input capture register (low) input capture register (high) 16-bit timer control register unimplemented unimplemented unimplemented unimplemented spi status register spi control register spi data register port d data register reserved unimplemented current direction register dmina current direction register dmajb irq status and control register unused 8-bit timer status and control current direction register dminb current direction register dminc current direction register dmind 8-bit timer counter register $0001 $0002 $0003 $0004 $0005 $0006 $0007 $0008 $0009 $000a $000b $000c $000d $000e $000f $0010 $0011 $0012 $0013 $0014 $0015 $0016 $0017 $0018 $0019 $001a $001b $001c $001d $001e $001f $0020 $0021 $0022 $0023 $0024 $0025 $0026 $0027 $0028 $0029 $002a $002b $002c $002d $002e $002f $0030 $0031 $0032 $0033 $0034 $0035 $0036 $0037 $0038 $0039 $003a $003b $003c $003d $003e $003f gauge enable register ger scan status & control reg sscr magnitude register mina1 magnitude register majb2 magnitude register maja1 magnitude register majb1 magnitude register maja2 magnitude register mina2 magnitude register minb1 magnitude register minb2 magnitude register minc1 magnitude register minc2 magnitude register mind1 magnitude register mind2 reserved miscellaneous register pwma data register pwma control register pwmb data register pwmb control register bdlc control register 1 bdlc control register 2 bdlc state vector register bdlc data register bdlc analog roundtrip delay register current direction register dmaja f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required memory map general release specification mc68HC05V12 rev. 1.0 memory map 2.4 ram the total ram consists of 384 bytes (including the stack). the stack begins at address $00ff and proceeds down to $00c0 (64 bytes). using the stack area for data storage or temporary work locations requires care to prevent it from being overwritten due to stacking from an interrupt or subroutine call. note: the stack is located in the middle of the ram address space. data written to addresses within the stack address range can be overwritten during stack activity. 2.5 boot rom the boot rom space in the mc68HC05V12 consists of 1008 bytes including eeprom test code, burn-in code, and 16 bytes of bootloader vectors. 2.6 user rom there are 12,032 bytes of user rom and 16 bytes of rom for user vectors and the cop update location. 2.7 eeprom this device contains 256 bytes of eeprom. programming the eeprom is performed by the user on a single-byte basis by manipulating the programming register located at address $001c. refer to section 12. eeprom for programming details. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
memory map eeprom mc68HC05V12 rev. 1.0 general release specification memory map non-disclosure agreement required addr. register read/ write bit 7 6 5 4321 bit 0 $0000 port a data porta r0 pa6 pa5 pa4 pa3 pa2 pa1 pa0 w $0001 port b data portb r pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 w $0002 port c data portc r pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 w $0003 port d data portd r 0 0 0 pd4 pd3 pd2 pd1 pd0 w $0004 port a data direction ddra r0 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 w $0005 port b data direction ddrb r ddrb7 ddrb6 ddrb5 ddrb4 ddrb3 ddrb2 ddrb1 ddrb0 w $0006 port c data direction ddrc r ddrc7 ddrc6 ddrc5 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 w $0007 unimplemented r w $0008 core timer status and control ctscr r ctof rtif tofe rtie 00 rt1 rt0 w tofc rtifc $0009 core timer counter ctcr r tmr7 tmr6 tmr5 tmr4 tmr3 tmr2 tmr1 tmr0 w $000a spi control scr r spie spe mstr cpol cpha spr1 spr0 w $000b spi status ssr r spif wcol modf w $000c spi data sdr r spd7 spd6 spd5 spd4 spd3 spd2 spd1 spd0 w $000d unimplemented r w $000e unimplemented r w $000f unimplemented r w = unimplemented r = reserved figure 2-3. i/o registers $0000C$000f f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required memory map general release specification mc68HC05V12 rev. 1.0 memory map addr. register read/ write bit 7 6 5 4 3 2 1 bit 0 $0010 unimplemented r w $0011 unimplemented r w $0012 16-bit timer control tmrcr r icie ocie toie ton iedg olvl w $0013 16-bit timer status tmrsr r icf ocf tof w $0014 input capture high tcap (high) r ic15 ic14 ic13 ic12 ic11 ic10 ic9 ic8 w $0015 input capture low tcap (low) r ic7 ic6 ic5 ic4 ic3 ic2 ic1 ic0 w $0016 output compare high tcmp (high) r oc15 oc14 oc13 oc12 oc11 oc10 oc9 oc8 w $0017 output compare low tcmp (low) r oc7 oc6 oc5 oc4 oc3 oc2 oc1 oc0 w $0018 timer counter high tcnt (high) r cnt15 cnt14 cnt13 cnt12 cnt11 cnt10 cnt9 cnt8 w $0019 timer counter low tcnt (low) r cnt7 cnt6 cnt5 cnt4 cnt3 cnt2 cnt1 cnt0 w $001a alternate counter high altcnt (high) r ac15 ac14 ac13 ac12 ac11 ac10 ac9 ac8 w $001b alternate counter low altcnt (low) r ac7 ac6 ac5 ac4 ac3 ac2 ac1 ac0 w $001c eeprom programming eeprog r cpen er1 er0 eelat eerc eepgm w $001d a/d data addr r ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0 w $001e a/d status and control adscr r coco adrc adon ch4 ch3 ch2 ch1 ch0 w $001f irq status and control iscr r irqe ipce irqf ipcf 0 w irqa = unimplemented figure 2-4. i/o registers $0010C$001f f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
memory map eeprom mc68HC05V12 rev. 1.0 general release specification memory map non-disclosure agreement required addr. register read/ write bit 7 6 5 4 3 2 1 bit 0 $0020 gauge enable ger r mjaon mjbon miaon mibon micon midon cmps r w $0021 scan status/ control sscr r synie synf 0 r gcs1 gcs0 scns autos w synr $0022 maja1 magnitude maja1 r b7 b6 b5 b4 b3 b2 b1 b0 w $0023 maja2 magnitude maja2 r b7 b6 b5 b4 b3 b2 b1 b0 w $0024 majb1 magnitude majb1 r b7 b6 b5 b4 b3 b2 b1 b0 w $0025 majb2 magnitude majb2 r b7 b6 b5 b4 b3 b2 b1 b0 w $0026 mina1 magnitude mina1 r b7 b6 b5 b4 b3 b2 b1 b0 w $0027 mina2 magnitude mina2 r b7 b6 b5 b4 b3 b2 b1 b0 w $0028 minb1 magnitude minb1 r b7 b6 b5 b4 b3 b2 b1 b0 w $0029 minb2 magnitude minb2 r b7 b6 b5 b4 b3 b2 b1 b0 w $002a minc1 magnitude minc1 r b7 b6 b5 b4 b3 b2 b1 b0 w $002b minc2 magnitude minc2 r b7 b6 b5 b4 b3 b2 b1 b0 w $002c mind1 magnitude mind1 r b7 b6 b5 b4 b3 b2 b1 b0 w $002d mind2 magnitude mind2 r b7 b6 b5 b4 b3 b2 b1 b0 w $002e maja current direction dmaja r 0 0 0 0 0 0 dmja1 dmja2 w $002f majb current direction dmajb r 0 0 0 0 0 0 dmjb1 dmjb2 w r = reserved figure 2-5. i/o registers $0020C$002f f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required memory map general release specification mc68HC05V12 rev. 1.0 memory map addr. register read/ write bit 7 6 5 4 3 2 1 bit 0 $0030 mina current direction dmina r 0 0 0 0 0 0 0 dmia w $0031 minb current direction dminb r 0 0 0 0 0 0 0 dmib w $0032 minc current direction dminc r 0 0 0 0 0 0 0 dmic w $0033 mind current direction dmind r 0 0 0 0 0 0 0 dmid w $0034 reserved r r r r r r r r r w $0035 miscellaneous miscr r 0 oce 0 0 0 0 0 0 w $0036 pwma data pwmad r pola 0 d5 d4 d3 d2 d1 d0 w $0037 pwma control pwmac r psa1a psa0a 0 0 psb3a psb2a psb1a psb0a w $0038 pwmb data pwmbd r polb 0 d5 d4 d3 d2 d1 d0 w $0039 pwmb control pwmbc r psa1b psa0b 0 0 psb3b psb2b psb1b psb0b w $003a bdlc control 1 bcr1 r imsg clks r1 r0 0 0 ie wcm w $003b bdlc control 2 bcr2 r albe dlbe rx4xe nbfs teod tsifr tmifr1 tmifr0 w $003c bdlc state vector bsvr r 0 0 i3i2i1i0 0 0 w $003d bdlc data bdatr r bd7 bd6 bd5 bd4 bd3 bd2 bd1 bd0 w $003e bdlc analog round trip delay bard r ats rxpol 0 0 bo3 bo2 bo1 bo0 w $003f reserved r r r r r r r r r w = one-time write = unimplemented r = reserved figure 2-6. i/o registers $0030C$003f f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
memory map miscellaneous register mc68HC05V12 rev. 1.0 general release specification memory map non-disclosure agreement required 2.8 miscellaneous register the miscellaneous register is located at $0035. oce output compare enable this bit controls the function of the pb6 pin. 0 = pb6 functions as a normal i/o pin. 1 = pb6 becomes the tcmp output pin for the 16-bit timer. see section 9. 16-bit timer for a description of the tcmp function. $0035 bit 7 654321 bit 0 read: 0 oce 000000 write: reset: 00000000 = unimplemented figure 2-7. miscellaneous register (misc) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required memory map general release specification mc68HC05V12 rev. 1.0 memory map f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification central processing unit (cpu) non-disclosure agreement required general release specification mc68HC05V12 section 3. central processing unit (cpu) 3.1 contents 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 3.3 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 3.3.1 accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 3.3.2 index register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 3.3.3 stack pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 3.3.4 program counter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 3.3.5 condition code register . . . . . . . . . . . . . . . . . . . . . . . . . . .48 3.4 arithmetic/logic unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 3.2 introduction this section describes the cpu registers. 3.3 cpu registers figure 3-1 shows the five cpu registers. cpu registers are not part of the memory map. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required central processing unit (cpu) general release specification mc68HC05V12 rev. 1.0 central processing unit (cpu) figure 3-1. programming model 3.3.1 accumulator the accumulator (a) is a general-purpose 8-bit register. the cpu uses the accumulator to hold operands and results of arithmetic and non- arithmetic operations. accumulator (a) a index register (x) x sp 11 00 00 0 00 0 pcl pch 0 0 zc in 1h 11 0 4 75 condition code register (ccr) program counter (pc) stack pointer (sp) 0 7 8 15 15 5 7 7 0 0 0 half-carry flag interrupt mask negative flag zero flag carry/borrow flag 10 6 bit 7 654321 bit 0 read: write: reset: unaffected by reset figure 3-2. accumulator (a) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
central processing unit (cpu) cpu registers mc68HC05V12 rev. 1.0 general release specification central processing unit (cpu) non-disclosure agreement required 3.3.2 index register in the indexed addressingmodes, the cpu uses the byte in the index register (x) to determine the conditional address of the operand. the 8-bit index register can also serve as a temporary data storage location. 3.3.3 stack pointer the stack pointer (sp) is a 16-bit register that contains the address of the next location on the stack. during a reset or after the reset stack pointer (rsp) instruction, the stack pointer is preset to $00ff. the address in the stack pointer decrements as data is pushed onto the stack and increments as data is pulled from the stack. the 10 most significant bits of the stack pointer are permanently fixed at 000000011, so the stack pointer produces addresses from $00c0 to $00ff. if subroutines and interrupts use more than 64 stack locations, the stack pointer wraps around to address $00ff and begins writing over the previously stored data. a subroutine uses two stack locations. an interrupt uses five locations. bit 7 654321 bit 0 read: write: reset: unaffected by reset figure 3-3. index register (x) bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 bit 0 read: write: reset: 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 figure 3-4. stack pointer (sp) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required central processing unit (cpu) general release specification mc68HC05V12 rev. 1.0 central processing unit (cpu) 3.3.4 program counter the program counter (pc) is a 16-bit register that contains the address of the next instruction or operand to be fetched. the two most significant bits of the program counter are ignored internally and appear as 00. normally, the address in the program counter automatically increments to the next sequential memory location every time an instruction or operand is fetched. jump, branch, and interrupt operations load the program counter with an address other than that of the next sequential location. 3.3.5 condition code register the condition code register (ccr) is an 8-bit register whose three most significant bits are permanently fixed at 111. the condition code register contains the interrupt mask and four flags that indicate the results of the instruction just executed. the following paragraphs describe the functions of the condition code register. bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 bit 0 read: 00 5 write: reset 0 0 loaded with vectors from $3ff3 and $3fff figure 3-5. program counter (pc) bit 7 654321 bit 0 read: 1 1 1 hinzc write: reset: 1 1 1u1uuu = unimplemented u = unaffected figure 3-6. condition code register (ccr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
central processing unit (cpu) cpu registers mc68HC05V12 rev. 1.0 general release specification central processing unit (cpu) non-disclosure agreement required half-carry flag the cpu sets the half-carry flag when a carry occurs between bits 3 and 4 of the accumulator during an add or adc operation. the half- carry flag is required for binary coded decimal (bcd) arithmetic operations. interrupt mask setting the interrupt mask disables interrupts. if an interrupt request occurs while the interrupt mask is logic zero, the cpu saves the cpu registers on the stack, sets the interrupt mask, and then fetches the interrupt vector. if an interrupt request occurs while the interrupt mask is set, the interrupt request is latched. normally, the cpu processes the latched interrupt as soon as the interrupt mask is cleared again. a return from interrupt (rti) instruction pulls the cpu registers from the stack, restoring the interrupt mask to its cleared state. after any reset, the interrupt mask is set and can be cleared only by a software instruction. negative flag the cpu sets the negative flag when an arithmetic operation, logical operation, or data manipulation produces a negative result. zero flag the cpu sets the zero flag when an arithmetic operation, logical operation, or data manipulation produces a result of $00. carry/borrow flag the cpu sets the carry/borrow flag when an addition operation produces a carry out of bit 7 of the accumulator or when a subtraction operation requires a borrow. some logical operations and data manipulation instructions also clear or set the carry/borrow flag. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required central processing unit (cpu) general release specification mc68HC05V12 rev. 1.0 central processing unit (cpu) 3.4 arithmetic/logic unit the arithmetic/logic unit (alu) performs the arithmetic and logical operations defined by the instruction set. the binary arithmetic circuits decode instructions and set up the alu for the selected operation. most binary arithmetic is based on the addition algorithm, carrying out subtraction as negative addition. multiplication is not performed as a discrete operation but as a chain of addition and shift operations within the alu. the multiply instruction (mul) requires 11 internal clock cycles to complete this chain of operations. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification interrupts non-disclosure agreement required general release specification mc68HC05V12 section 4. interrupts 4.1 contents 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 4.3 cpu interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 4.4 reset interrupt sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 4.5 software interrupt (swi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 4.6 hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 4.7 external interrupt (irq) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 4.7.1 irq status and control register. . . . . . . . . . . . . . . . . . . . .58 4.7.2 external interrupt timing . . . . . . . . . . . . . . . . . . . . . . . . . . .60 4.8 16-bit timer interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 4.9 bdlc interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 4.10 spi interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 4.11 8-bit timer interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 4.12 gauge synchronize interrupt . . . . . . . . . . . . . . . . . . . . . . . . . .62 4.13 stop and wait modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required interrupts general release specification mc68HC05V12 rev. 1.0 interrupts 4.2 introduction the mcu can be interrupted eight different ways: 1. non-maskable software interrupt instruction (swi) 2. external asynchronous interrupt (irq) 3. external interrupt via irq on pc0Cpc7 (irq) 4. internal 16-bit timer interrupt (timer) 5. internal bdlc interrupt (bdlc) 6. internal serial peripheral interface interrupt (spi) 7. internal 8-bit timer interrupt (ctimer) 8. internal gauge interrupt (gauge) 4.3 cpu interrupt processing interrupts cause the processor to save register contents on the stack and to set the interrupt mask (i bit) to prevent additional interrupts. unlike reset, hardware interrupts do not cause the current instruction execution to be halted, but are considered pending until the current instruction is complete. if interrupts are not masked (i bit in the ccr is clear) and the corresponding interrupt enable bit is set, then the processor will proceed with interrupt processing. otherwise, the next instruction is fetched and executed. if an interrupt occurs, the processor completes the current instruction, then stacks the current cpu register states, sets the i bit to inhibit further interrupts, and finally checks the pending hardware interrupts. if more than one interrupt is pending after the stacking operation, the interrupt with the highest vector location shown in table 4-1 will be serviced first. the swi is executed the same as any other instruction, regardless of the i-bit state. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
interrupts cpu interrupt processing mc68HC05V12 rev. 1.0 general release specification interrupts non-disclosure agreement required when an interrupt is to be processed, the cpu fetches the address of the appropriate interrupt software service routine from the vector table at locations $3ff0 through $3fff as defined in table 4-1 . because the m68hc05 cpu does not support interruptible instructions, the maximum latency to the first instruction of the interrupt service routine must include the longest instruction execution time plus stacking overhead. latency = (longest instruction execution time + 10) x t cyc secs an rti instruction is used to signify when the interrupt software service routine is completed. the rti instruction causes the register contents to be recovered from the stack and normal processing to resume at the next instruction that was to be executed when the interrupt took place. figure 4-1 shows the sequence of events that occur during interrupt processing. table 4-1. vector address for interrupts and reset register flag name interrupts cpu interrupt vector address n/a n/a reset reset $3ffe-$3fff n/a n/a software swi $3ffc-$3ffd iscr irqf/ipcf external (irq & port c) irq $3ffa-$3ffb tsr tof timer over?ow timer $3ff8-$3ff9 tsr ocf output compare timer $3ff8-$3ff9 tsr icf input capture timer $3ff8-$3ff9 bsvr i3:i0 bdlc bdlc $3ff6-$3ff7 spsr spif spi spi $3ff4-$3ff5 ctscr ctof core timer over?ow ctimer $3ff2-$3ff3 ctscr rtif real time ctimer $3ff2-$3ff3 sscr synf gauge synchronize gauge $3ff0-$3ff1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required interrupts general release specification mc68HC05V12 rev. 1.0 interrupts figure 4-1. interrupt processing flowchart n restore registers from stack: ccr, a, x, pc port c or irq interrupt? load pc from appropriate vector set i bit in cc register stack pc, x, a, ccr clear irq request latch fetch next instruction execute instruction n n y y y n i bit in ccr set? spi interrupt? swi instruction ? n y rti instruction ? y from reset n y 16-bit timer interrupt? n y bdlc interrupt? n y 8-bit timer interrupt? n y gauge interrupt? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
interrupts reset interrupt sequence mc68HC05V12 rev. 1.0 general release specification interrupts non-disclosure agreement required 4.4 reset interrupt sequence the reset function is not in the strictest sense an interrupt; however, it is acted upon in a similar manner as shown in figure 4-1 . a low level input on the reset pin or internally generated rst signal causes the program to vector to its starting address which is specified by the contents of memory locations $3ffe and $3fff. the i bit in the condition code register is also set. the mcu is configured to a known state during this type of reset as described in section 5. resets . 4.5 software interrupt (swi) the swi is an executable instruction and a non-maskable interrupt since it is executed regardless of the state of the i bit in the ccr. if the i bit is zero (interrupts enabled), the swi instruction executes after interrupts which were pending before the swi was fetched or before interrupts generated after the swi was fetched. the interrupt service routine address is specified by the contents of memory locations $3ffc and $3ffd. 4.6 hardware interrupts all hardware interrupts except reset are maskable by the i bit in the ccr. if the i bit is set, all hardware interrupts (internal and external) are disabled. clearing the i bit enables the hardware interrupts. two types of hardware interrupts are explained in the following paragraphs. 4.7 external interrupt (irq) the irq pin provides an asynchronous interrupt to the cpu. a block diagram of the irq function is shown in figure 4-2 . note: the bih and bil instructions will apply only to the level on the irq pin itself and not to the output of the logic or function with the port c irq interrupts. the state of the individual port c pins can be checked by reading the appropriate port c pins as inputs. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required interrupts general release specification mc68HC05V12 rev. 1.0 interrupts figure 4-2 . irq function block diagram the irq pin is one source of an external interrupt. all port c pins (pc0 through pc7) act as other external interrupt sources. these sources have their own interrupt latch but are combined with irq into a single external interrupt request. the port c interrupt sources are negative (falling) edge-sensitive only. note that all port c pins are anded together to form the negative edge signal which sets the corresponding flag bits. a high-to-low transition on any port c pin configured as an interrupt input will, therefore, set the respective flag bit. if a port c pin is to be used as an interrupt input, the corresponding data direction and data bits must both be cleared. if either the pin is configured as an output or the data bit is set, a falling edge on the pin will not generate an interrupt. the irq pin interrupt source may irq latch r v dd irq pin irqe level (mask option) irqf to irq processing in cpu irqa to bih & bil instruction sensing rst r ipce ipcf irq vector fetch v dd irqpc latch pc0 pc7 ddrc0 ddrc7 drc0 drc0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
interrupts external interrupt (irq) mc68HC05V12 rev. 1.0 general release specification interrupts non-disclosure agreement required be selected to be either edge sensitive or edge and level sensitive through a mask option. if the edge-sensitive interrupt option is selected for the irq pin, only the irq latch output can activate an irqf flag which creates an interrupt request to the cpu to generate the external interrupt sequence. when edge sensitivity is selected for the irq interrupt, it is sensitive to the following cases: 1. falling edge on the irq pin 2. falling edge on any port c pin with irq enabled if the edge and level mask option is selected, the active low state of the irq pin can also activate an irqf flag which creates an irq request to the cpu to generate the irq interrupt sequence. when edge and level sensitivity are selected for the irq interrupt, it is sensitive to the following cases: 1. low level on the irq pin 2. falling edge on the irq pin 3. falling edge on any port c pin with irq enabled the irqe enable bit controls whether an active irqf flag ( irq pin interrupt) can generate an irq interrupt sequence. the ipce enable bit controls whether an active ipcf flag (port c interrupt) can generate an irq interrupt sequence. the irq interrupt is serviced by the interrupt service routine located at the address specified by the contents of $3ffa and $3ffb. the irqf latch is cleared automatically by entering the interrupt service routine to maintain compatibility with existing m6805 interrupt servicing protocol. to allow the user to identify the source of the interrupt, the port interrupt flag (ipcf) is not cleared automatically. this flag must be cleared within the interrupt handler prior to exit to prevent repeated re- entry. this is achieved by writing a logic one to the irqa (irq acknowledge) bit, which will clear all pending irq interrupts (including a pending irq pin interrupt). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required interrupts general release specification mc68HC05V12 rev. 1.0 interrupts the interrupt request flag (ipcf) is read only and cannot be cleared by writing to it. the acknowledge flag always reads as a logic 0. together, these features permit the safe use of read-modify-write instructions (for instance, bset and bclr) on the iscr. note: although read-modify-write instruction use is allowable on the iscr, shift operations should be avoided due to the possibility of inadvertently setting the irqa. 4.7.1 irq status and control register the irq interrupt function is controlled by the irq status and control register (iscr) located at $001f. all unused bits in the iscr will read as logic zeros. the irqf bit is cleared and irqe bit is set by reset. irqe - irq interrupt enable the irqe bit controls whether the irqf flag bit can or cannot initiate an irq interrupt sequence. if the irqe enable bit is set, the irqf flag bit can generate an interrupt sequence. if the irqe enable bit is cleared, the irqf flag bit cannot generate an interrupt sequence. reset sets the irqe enable bit, thereby enabling irq interrupts once the i bit is cleared. execution of the stop or wait instructions causes the irqe bit to be set to allow the external irq to exit these modes. in addition, reset also sets the i bit, which masks all interrupt sources. ipce - port c irq interrupt enable the ipce bit controls whether the ipcf flag bit can or cannot initiate an irq interrupt sequence. if the ipce enable bit is set, the ipcf flag bit will generate an interrupt sequence. if the ipce enable bit is $001f bit 7 654321 bit 0 read: irqe 0 ipce 0 irqf 0 ipcf 0 write: irqa reset: 10000000 = unimplemented figure 4-3. irq status and control register (iscr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
interrupts external interrupt (irq) mc68HC05V12 rev. 1.0 general release specification interrupts non-disclosure agreement required cleared, the ipcf flag bit will not generate an interrupt sequence. reset clears the ipce enable bit, thereby disabling port c irq interrupts. in addition, reset also sets the i bit, which masks all interrupt sources. execution of the stop or wait instructions does not effect the ipce bit. note: the ipce mask bit must be set prior to entering stop or wait modes if port irq interrupts are to be enabled. irqf - irq interrupt request the irqf flag bit indicates that an irq request is pending. writing to the irqf flag bit will have no effect on it. the irqf flag bit is cleared when the irq vector is fetched prior to the service routine being entered. the irqf flag bit can also be cleared by writing a logic one to the irqa acknowledge bit to clear the irq latch. in this way any additional irqf flag bit that is set while in the service routine can be ignored by clearing the irqf flag bit before exiting the service routine. if the additional irqf flag bit is not cleared in the irq service routine and the irqe enable bit remains set, the cpu will re-enter the irq interrupt sequence continuously until either the irqf flag bit or the irqe enable bit is clear. this flag can be set only when the irqe enable is set. the irq latch is cleared by reset. ipcf - port c irq interrupt request the ipcf flag bit indicates that a port c irq request is pending. writing to the ipcf flag bit will have no effect on it. the ipcf flag bit must be cleared by writing a logic 1 to the irqa acknowledge bit. if the ipcf bit is not cleared via irqa, the cpu will re-enter the irq interrupt sequence continuously until either the ipcf flag bit or the ipce enable bit is clear. this bit is operational regardless of the state of the ipce bit. the ipcf bit is cleared by reset. irqa - irq interrupt acknowledge the irqa acknowledge bit clears an irq interrupt by clearing the irqf and ipcf bits. this is achieved by writing a logic 1 to the irqa acknowledge bit. writing a logic 0 to the irqa acknowledge bit will have no effect on the any of the irq bits. if either the irqf or ipcf bit is not cleared within the irq service routine, then the cpu will re- enter the irq interrupt sequence continuously until the irq flag bits f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required interrupts general release specification mc68HC05V12 rev. 1.0 interrupts are all cleared. the irqa is useful for cancelling unwanted or spurious interrupts which may have occurred while servicing the initial irq interrupt. note: the irq flag is cleared automatically during the irq vector fetch. the irqpc latch is not cleared automatically (to permit interrupt source differentiation as long as the interrupt source is present) and must be cleared from within the irq service routine. 4.7.2 external interrupt timing if the interrupt mask bit (i bit) of the ccr is set, all maskable interrupts (internal and external) are disabled. clearing the i bit enables interrupts. the interrupt request is latched immediately following the falling edge of the irq source. it is then synchronized internally and serviced as specified by the contents of $3ffa and $3ffb. the irq timing diagram is shown in figure 4-4 . figure 4-4. external interrupts timing diagram irq t ilih t ilil t ilih irq 1 (port) irq n (port) irq (mcu) . . . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
interrupts 16-bit timer interrupt mc68HC05V12 rev. 1.0 general release specification interrupts non-disclosure agreement required either a level-sensitive and edge-sensitive trigger, or an edge-sensitive- only trigger is available as a mask option for the irq pin only. 4.8 16-bit timer interrupt three different timer interrupt flags cause a 16-bit timer interrupt whenever they are set and enabled. the interrupt flags are in the timer status register (tsr), and the enable bits are in the timer control register (tcr). any of these interrupts will vector to the same interrupt service routine, located at the address specified by the contents of memory location $3ff8 and $3ff9. 4.9 bdlc interrupt the interrupt service routine is located at the address specified by the contents of memory location $3ff6 and $3ff7. 4.10 spi interrupt two different spi interrupt flags cause an spi interrupt whenever they are set and enabled. the interrupt flags are in the spi status register (spsr), and the enable bits are in the spi control register (spcr). either of these interrupts will vector to the same interrupt service routine, located at the address specified by the contents of memory location $3ff4 and $3ff5. 4.11 8-bit timer interrupt this timer can create two types of interrupts. a timer overflow interrupt will occur whenever the 8-bit timer rolls over from $ff to $00 and the enable bit tofe is set. a real-time interrupt will occur whenever the programmed time elapses and the enable bit rtie is set. this interrupt will vector to the interrupt service routine located at the address specified by the contents of memory location $3ff2 and $3ff3. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required interrupts general release specification mc68HC05V12 rev. 1.0 interrupts 4.12 gauge synchronize interrupt this interrupt service routine is located at the address specified by the contents of memory location $3ff0 and $3ff1. see 15.6.2 current magnitude registers for further details. 4.13 stop and wait modes all modules which are capable of generating interrupts in stop or wait mode will be allowed to do so if the module is configured properly. the i bit is cleared automatically when stop or wait mode is entered. interrupts detected on port c are recognized in stop or wait mode if port c interrupts are enabled. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification resets non-disclosure agreement required general release specification mc68HC05V12 section 5. resets 5.1 contents 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 5.3 external reset ( reset). . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 5.4 internal resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 5.4.1 power-on reset (por). . . . . . . . . . . . . . . . . . . . . . . . . . . .65 5.4.2 computer operating properly reset (copr) . . . . . . . . . . .66 5.4.2.1 resetting the cop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 5.4.2.2 cop during wait mode . . . . . . . . . . . . . . . . . . . . . . . . . .67 5.4.2.3 cop during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . .67 5.4.2.4 cop watchdog timer considerations . . . . . . . . . . . . . . .67 5.4.2.5 cop register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 5.4.3 illegal address reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69 5.4.4 disabled stop instruction reset . . . . . . . . . . . . . . . . . . . .69 5.4.5 low-voltage reset (lvr) . . . . . . . . . . . . . . . . . . . . . . . . . .69 5.4.6 lvr operation in stop and wait modes . . . . . . . . . . . . . . .70 5.2 introduction the mcu can be reset from six sources: one external input and five internal restart conditions. the reset pin is an input with a schmitt trigger as shown in figure 5-1 . all the internal peripheral modules will be reset by the internal reset signal (rst). refer to figure 5-2 for reset timing detail. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required resets general release specification mc68HC05V12 rev. 1.0 resets figure 5-1 . reset block diagram 5.3 external reset ( reset) the reset pin is the only external source of a reset. this pin is connected to a schmitt trigger input gate to provide an upper and lower threshold voltage separated by a minimum amount of hysteresis. this external reset occurs whenever the reset pin is pulled below the lower threshold and remains in reset until the reset pin rises above the upper threshold. this active low input will generate the rst signal and reset the cpu and peripherals. note: activation of the rst signal is generally referred to as reset of the device, unless otherwise specified. the reset pin can also act as an open drain output. it will be pulled to a low state by an internal pulldown that is activated by any reset source. this reset pulldown device will only be asserted for three to four cpu latch reset cop watchdog ( copr ) rst osc data address ph2 to other peripherals s low-voltage reset (lvr) v dd irq mode select to irq logic latch r power-on reset ( por ) v dd illegal address ( iladdr ) address ph2 clocked one-shot (pulse width = 3 x t cyc ) d d disabled stop instruction stopen f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
resets internal resets mc68HC05V12 rev. 1.0 general release specification resets non-disclosure agreement required cycles of the internal clock, f op , or as long as an internal reset source is asserted. when the external reset pin is asserted, the pulldown device will be turned on for only the three to four internal clock cycles. 5.4 internal resets the five internally generated resets are the initial power-on reset function, the cop watchdog timer reset, the illegal address detector, the low-voltage reset, and the disabled stop instruction. all internal resets will also assert (pull to logic 0) the external reset pin for the duration of the reset or three to four internal clock cycles, whichever is longer. 5.4.1 power-on reset (por) the internal por is generated on power-up to allow the clock oscillator to stabilize. the por is strictly for power turn-on conditions and is not able to detect a drop in the power supply voltage (brown-out). there is an oscillator stabilization delay of 4064 internal processor bus clock cycles (ph2) after the oscillator becomes active. the por will generate the rst signal which will reset the cpu. if any other reset function is active at the end of this 4064-cycle delay, the rst signal will remain in the reset condition until the other reset condition(s) end. por will activate the reset pin pulldown device connected to the pin. v dd must drop below v por for the internal por circuit to detect the next rise of v dd . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required resets general release specification mc68HC05V12 rev. 1.0 resets figure 5-2. reset and por timing diagram 5.4.2 computer operating properly reset (copr) the mcu contains a watchdog timer that automatically times out if not reset (cleared) within a specific time by a program reset sequence. if the cop watchdog timer is allowed to time out, an internal reset is generated to reset the mcu. regardless of an internal or external reset, the mcu comes out of a cop reset according to the pin conditions that determine mode selection. the cop reset function is enabled or disabled by the cop mask option. pch pcl osc1 2 reset internal processor internal address bus 1 3ffe 3fff v dd 4064 t cyc t cyc t rl internal data bus 1 3ffe 3ffe 3ffe 3ffe new pc 3fff notes: 1. internal timing signal and bus information are not available externally. 2. osc1 line is not meant to represent frequency. it is only used to represent time. 3. the next rising edge of the internal processor clock following the rising edge of reset initiates the reset sequence. 3 new new op code pcl pch new pc new pc op code new pc clock 1 0 v f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
resets internal resets mc68HC05V12 rev. 1.0 general release specification resets non-disclosure agreement required the cop watchdog reset will activate the internal pulldown device connected to the reset pin. 5.4.2.1 resetting the cop preventing a cop reset is done by writing a 0 to the copr bit. this action will reset the counter and begin the timeout period again. the copr bit is bit 0 of address $3ff0. a read of address $3ff0 will return user data programmed at that location. 5.4.2.2 cop during wait mode the cop will continue to operate normally during wait mode. the system should be configured to pull the device out of wait mode periodically and reset the cop by writing to the copr bit to prevent a cop reset. 5.4.2.3 cop during stop mode when the stop enable mask option is selected, stop mode disables the oscillator circuit and thereby turns the clock off for the entire device. the cop counter will be reset when stop mode is entered. if a reset is used to exit stop mode, the cop counter will be held in reset during the 4064 cycles of startup delay. if any operable interrupt is used to exit stop mode, the cop counter will not be reset during the 4064-cycle startup delay and will have that many cycles already counted when control is returned to the program. 5.4.2.4 cop watchdog timer considerations the cop watchdog timer is active in user mode if enabled by the cop mask option. if the cop watchdog timer is selected, any execution of the stop instruction (either intentional or inadvertent due to the cpu being disturbed) will cause the oscillator to halt and prevent the cop watchdog timer from timing out. therefore, it is recommended that the stop instruction should be disabled if the cop watchdog timer is enabled. if the cop watchdog timer is selected, the cop will reset the mcu when it times out. therefore, it is recommended that the cop watchdog f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required resets general release specification mc68HC05V12 rev. 1.0 resets should be disabled for a system that must have intentional uses of the wait mode for periods longer than the cop timeout period. the recommended interactions and considerations for the cop watchdog timer, stop instruction, and wait instruction are summarized in table 5-1 . 5.4.2.5 cop register the cop register is shared with the msb of an unimplemented user interrupt vector as shown in figure 5-3 . reading this location will return whatever user data has been programmed at this location. writing a 0 to the copr bit in this location will clear the cop watchdog timer. table 5-1. cop watchdog timer recommendations if the following conditions exist: then the cop watchdog timer should be as follows: stop instruction wait time converted to reset wait time less than cop timeout enable or disable cop converted to reset wait time more than cop timeout disable cop acts as stop any length wait time disable cop $3ff0 bit 7 654321 bit 0 read: x x x x x x x x write: copr reset: x x x x x x x x = unimplemented figure 5-3. cop watchdog timer location f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
resets internal resets mc68HC05V12 rev. 1.0 general release specification resets non-disclosure agreement required 5.4.3 illegal address reset an illegal address reset is generated when the cpu attempts to fetch an instruction from either unimplemented address space ($01c0 to $023f and $0340 to $0cff) or i/o address space ($0000 to $003f). the illegal address reset will activate the internal pulldown device connected to the reset pin. 5.4.4 disabled stop instruction reset when the mask option is selected to disable the stop instruction, execution of a stop instruction results in an internal reset. this activates the internal pulldown device connected to the reset pin. 5.4.5 low-voltage reset (lvr) the internal low voltage (lvr) reset is generated when v dd falls below the lvr threshold, v lvri, and will be released following a por delay starting when v dd rises above v lvrr . the lvr threshold is tested to be above the minimum operating voltage of the microcontroller and is intended to assure that the cpu will be held in reset when the v dd supply voltage is below reasonable operating limits. a mask option is provided to disable the lvr when the device is expected to normally operate at low voltages. note that the v dd rise and fall slew rates (s vddr and s vddf ) must be within the specification for proper lvr operation. if the specification is not met, the circuit will operate properly following a delay of v dd /slew rate. the lvr will generate the rst signal which will reset the cpu and other peripherals. the low-voltage reset will activate the internal pulldown device connected to the reset pin. if any other reset function is active at the end of the lvr reset signal, the rst signal will remain in the reset condition until the other reset condition(s) end. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required resets general release specification mc68HC05V12 rev. 1.0 resets 5.4.6 lvr operation in stop and wait modes if enabled, the lvr supply voltage sense option is active during stop and wait modes. any reset source can bring the mcu out of stop or wait mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification low-power modes non-disclosure agreement required general release specification mc68HC05V12 section 6. low-power modes 6.1 contents 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 6.3 stop instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 6.4 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 6.5 wait instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75 6.2 introduction the mc68hc705v12 is capable of running in one of several low-power operational modes. the wait and stop instructions provide two modes that reduce the power required for the mcu by stopping various internal clocks and/or the on-chip oscillator. the stop and wait instructions are not normally used if the cop watchdog timer is enabled. a programmable mask option is provided to convert the stop instruction to an internal reset. the flow of the stop and wait modes is shown in figure 6-2 . 6.3 stop instruction the stop instruction can result in one of two operations depending on the state of the mask option. if the stop option is enabled, the stop instruction operates like the stop in normal mc68hc05 family members and places the device in the low-power stop mode. if the stop option is disabled, the stop instruction will cause a chip reset when executed. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required low-power modes general release specification mc68HC05V12 rev. 1.0 low-power modes 6.4 stop mode execution of the stop instruction with the mask option enabled places the mcu in its lowest power consumption mode. in stop mode, the internal oscillator is turned off, halting all internal processing, including the cop watchdog timer. during stop mode, the tcr bits are altered to remove any pending timer interrupt request and to disable any further timer interrupts. the timer prescaler is cleared. the i bit in the ccr is cleared and the irqe mask is set in the icsr to enable external interrupts. all other registers and memory remain unaltered. all input/output lines remain unchanged. the mcu can be brought out of the stop mode only by: ?an irq pin external interrupt ? an externally generated reset ? a falling edge on any port c pin (if enabled) or ? a rising edge on the bdlc rxp pin when exiting the stop mode, the internal oscillator will resume after a 4064 internal processor clock cycle oscillator stabilization delay as shown in figure 6-1 . note: entering stop mode will cause the oscillator to stop and, therefore, disable the cop watchdog timer. if the cop watchdog timer is to be used, stop mode should be disabled by disabling the mask option. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
low-power modes stop mode mc68HC05V12 rev. 1.0 general release specification low-power modes non-disclosure agreement required figure 6-1. stop recovery timing diagram 3ffe 3ffe 3ffe 3ffe 3fff internal address bus internal clock irq 3 irq 2 reset osc1 1 t ilch 4064 t cyc reset or interrupt vector fetch (reset shown) t lih t rl notes: 1. represents the internal gating of the osc1 pin 2. irq pin edge-sensitive mask option or port c pin 3. irq pin level- and edge-sensitive mask option rxp idle f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required low-power modes general release specification mc68HC05V12 rev. 1.0 low-power modes figure 6-2. stop/wait flowcharts port c falling edge? y n rxp rising edge? y n rxp rising edge? y n 1. fetch reset vector or 2. service interrupt a. stack b. set i bit c. vector to interrupt routine wait stop enabled? y n external reset? y n irq external interrrupt? y n stop external oscillator, stop internal timer clock, and reset startup delay restart external oscillator, and stabilization delay stop internal processor clock, clear i bit in ccr end of startup delay y n irq external interrupt? y n external oscillator active, and internal timer clock active restart internal processor clock stop internal processor clock, clear i bit in ccr timer internal interrupt? y n external reset? y n stop port c falling edge? y n reset chip gauge sequence interrupt? y n spi interrupt? y n f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
low-power modes wait instruction mc68HC05V12 rev. 1.0 general release specification low-power modes non-disclosure agreement required 6.5 wait instruction the wait instruction places the mcu in a low-power mode, which consumes more power than stop mode. in wait mode, the internal processor clock is halted, suspending all processor and internal bus activity. internal timer clocks remain active, permitting interrupts to be generated from the timer or a reset to be generated from the cop watchdog timer. execution of the wait instruction automatically clears the i bit in the condition code register. all other registers, memory, and input/output lines remain in their previous states. if timer interrupts are enabled, a timer interrupt will cause the processor to exit the wait mode and resume normal operation. the timer may be used to generate a periodic exit from the wait mode. the mcu can be brought out of the wait mode by: ? a timer interrupt from either timer ? an spi interrupt ?an irq pin external interrupt ? an externally generated reset ? a falling edge on any port c pin (if enabled) ? a rising edge on the bdlc rxp pin or ? a gauge sequence interrupt f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required low-power modes general release specification mc68HC05V12 rev. 1.0 low-power modes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification parallel input/output (i/o) non-disclosure agreement required general release specification mc68HC05V12 section 7. parallel input/output (i/o) 7.1 contents 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 7.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 7.3.1 port a data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 7.3.2 port a data direction register . . . . . . . . . . . . . . . . . . . . . .79 7.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 7.4.1 port b data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 7.4.2 port b data direction register . . . . . . . . . . . . . . . . . . . . . .80 7.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 7.5.1 port c data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 7.5.2 port c data direction register . . . . . . . . . . . . . . . . . . . . . .81 7.5.3 port c i/o pin interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . .81 7.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82 7.2 introduction in single-chip mode, 23 bidirectional input/output (i/o) lines are arranged as two 8-bit i/o ports (ports b and c), and one 7-bit i/o port (port a). there is one 5-bit input port (port d). the individual bits in the i/o ports are programmable as either inputs or outputs under software control by the data direction registers (ddrs). the port c pins also have the additional property of acting as irq interrupt input sources. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required parallel input/output (i/o) general release specification mc68HC05V12 rev. 1.0 parallel input/output (i/o) 7.3 port a port a is a 7-bit bidirectional port which functions as shown in figure 7-1 . each pin is controlled by the corresponding bit in a data direction register and a data register. the port a data register is located at address $0000. the port a data direction register (ddra) is located at address $0004. reset clears ddra. the port a data register is unaffected by reset. figure 7-1. port a i/o circuitry 7.3.1 port a data register each port a i/o pin has a corresponding bit in the port a data register. when a port a pin is programmed as an output, the state of the corresponding data register bit determines the state of the output pin. when a port a pin is programmed as an input, any read of the port a data register will return the logic state of the corresponding i/o pin. the port a data register is unaffected by reset. read $0000 write $0000 read $0004 data register bit i/o pin output internal hc05 data bus reset (rst) write $0004 data direction register bit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
parallel input/output (i/o) port b mc68HC05V12 rev. 1.0 general release specification parallel input/output (i/o) non-disclosure agreement required 7.3.2 port a data direction register each port a i/o pin may be programmed as an input by clearing the corresponding bit in the ddra or programmed as an output by setting the corresponding bit in the ddra. the ddra can be accessed at address $0004 and is cleared by reset. 7.4 port b port b is an 8-bit bidirectional port. each port b pin is controlled by the corresponding bits in a data direction register and a data register as shown in figure 7-2 . pb5 and pb4 are shared with the pwms as shown in section 11. pulse width modulators (pwms) , pb7 and pb6 are shared with 16-bit timer functions. see section 9. 16-bit timer for timer description. pb0-pb3 are shared with the spi as shown in section 10. serial peripheral interface (spi) . the port b data register is located at address $0001. the port b data direction register (ddrb) is located at address $0005. reset clears the ddrb register. the port b data register is unaffected by reset. figure 7-2. port b i/o circuitry 16-bit timer, pmws, and spi mux logic read $0001 write $0001 read $0005 data register bit i/o pin output internal hc05 data bus reset (rst) write $0005 data direction register bit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required parallel input/output (i/o) general release specification mc68HC05V12 rev. 1.0 parallel input/output (i/o) 7.4.1 port b data register each port b i/o pin has a corresponding bit in the port b data register. when a port b pin is programmed as an output, the state of the corresponding data register bit determines the state of the output pin. when a port b pin is programmed as an input, any read of the port b data register will return the logic state of the corresponding i/o pin. the port b data register is unaffected by reset. 7.4.2 port b data direction register each port b i/o pin may be programmed as an input by clearing the corresponding bit in the ddrb or programmed as an output by setting the corresponding bit in the ddrb. the ddrb can be accessed at address $0005. the ddrb is cleared by reset. 7.5 port c port c is an 8-bit bidirectional port shared with the irq interrupt subsystem as shown in figure 7-3 . each pin is controlled by the corresponding bits in a data direction register and a data register. the port c data register is located at address $0002. the port c data direction register (ddrc) is located at address $0006. reset clears ddrc. the port c data register is unaffected by reset. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
parallel input/output (i/o) port c mc68HC05V12 rev. 1.0 general release specification parallel input/output (i/o) non-disclosure agreement required figure 7-3. port c i/o circuitry 7.5.1 port c data register each port c i/o pin has a corresponding bit in the port c data register. when a port c pin is programmed as an output, the state of the corresponding data register bit determines the state of the output pin. when a port c pin is programmed as an input, any read of the port c data register will return the logic state of the corresponding i/o pin. the port c data register is unaffected by reset. 7.5.2 port c data direction register each port c i/o pin may be programmed as an input by clearing the corresponding bit in the ddrc or programmed as an output by setting the corresponding bit in the ddrc. the ddrc can be accessed at address $0006 and is cleared by reset. 7.5.3 port c i/o pin interrupts the inputs of all eight bits of port c are anded into the irq input of the cpu. see figure 4-2 . this port has its own interrupt request latch to enable the user to differentiate between the irq sources. the port irq rread $0002 write $0002 read $0006 data register bit i/o pin output internal hc05 data bus reset (rst) write $0006 data direction register bit to irq subsystem see figure 4-2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required parallel input/output (i/o) general release specification mc68HC05V12 rev. 1.0 parallel input/output (i/o) inputs are falling edge sensitive only. any port c pin can be disabled as an interrupt input by setting the corresponding ddr bit or data register bit. to enable port pin interrupts, the corresponding ddr and data register bits must both be cleared. any port c pin that is configured as an output will not cause a port interrupt when the pin transitions from a 1 to a 0. note: the bih and bil instructions will apply only to the level on the irq pin itself and not to the internal irq input to the cpu. therefore, bih and bil cannot be used to obtain the result of the logical combination of the eight pins of port c. note: caution should be exercised when writing to the port c data register and data direction register due to their interaction with the irq subsystem as depicted in figure 4-2 . special care should be exercised in using read/modify/write instructions on these registers. 7.6 port d port d is a 5-bit input-only port which shares all of its pins with the a/d converter (ad0 through ad4) as shown in figure 7-4 . the port d data register is located at address $0003. when the a/d converter is active, one of these five input ports may be selected by the a/d multiplexer for conversion. a logical read of a selected input port will always return 0. figure 7-4. port d circuitry read $0003/2b input pin internal hc05 data bus v ss to a/d sampling circuitry to a/d channel select logic f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification core timer non-disclosure agreement required general release specification mc68HC05V12 section 8. core timer 8.1 contents 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 8.3 core timer status and control register. . . . . . . . . . . . . . . . . .85 8.4 computer operating properly (cop) reset . . . . . . . . . . . . . . .87 8.5 core timer counter register . . . . . . . . . . . . . . . . . . . . . . . . . .88 8.6 core timer during wait mode. . . . . . . . . . . . . . . . . . . . . . . . . .88 8.2 introduction the core timer for this device is a 12-stage multi-functional ripple counter. the features include timer overflow, power-on reset (por), real-time interrupt (rti), and computer operating properly (cop) watchdog timer. as seen in section 8. core timer , the internal peripheral clock is divided by four then drives an 8-bit ripple counter. the value of this 8-bit ripple counter can be read by the cpu at any time by accessing the core timer counter register (ctcr) at address $09. a timer overflow function is implemented on the last stage of this counter, giving a possible interrupt rate of the internal peripheral clock(e)/1024. this point is then followed by two more stages, with the resulting clock (e/2048) driving the real-time interrupt circuit (rti). the rti circuit consists of three divider stages with a 1-of-4 selector. the output of the rti circuit is further divided by eight to drive the mask optional cop watchdog timer circuit. the rti rate selector bits and the rti and ctof enable bits and flags are located in the timer control and status register at location $08. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required core timer general release specification mc68HC05V12 rev. 1.0 core timer figure 8-1. core timer block diagram cop clear internal bus $09 core timer counter register (ctcr ) 5-bit counter ctof rtif tofe rtie rt1 interrupt circuit $08 rti select circuit status register rt0 timer control & overflow circuit detect cop watchdog timer ( ? 8) to reset logic 88 rtfc tofc e/2 10 ctscr ctcr internal peripheral clock (e) to interrupt logic rti out e / 2 12 por e/2 2 divide /4 e / 2 9 e / 2 14 e / 2 13 e / 2 12 e / 2 11 2 3 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
core timer core timer status and control register mc68HC05V12 rev. 1.0 general release specification core timer non-disclosure agreement required 8.3 core timer status and control register the core timer status and control register (ctscr) contains the timer interrupt flag, the timer interrupt enable bits, and the real-time interrupt rate select bits. figure 8-2 shows the value of each bit in the ctscr when coming out of reset. ctof core timer overflow ctof is a read-only status bit set when the 8-bit ripple counter rolls over from $ff to $00. clearing the ctof is done by writing a 1 to tofc. writing to this bit has no effect. reset clears ctof. rtif real time interrupt flag the real-time interrupt circuit consists of a three-stage divider and a 1-of-4 selector. the clock frequency that drives the rti circuit is e/2**11 (or e/2048) with three additional divider stages giving a maximum interrupt period of 7.8 milliseconds at a bus rate of 2.1 mhz. rtif is a clearable, read-only status bit and is set when the output of the chosen (1-of-4 selection) stage goes active. clearing the rtif is done by writing a 1 to rtfc. writing has no effect on this bit. reset clears rtif. tofe timer overflow enable when this bit is set, a cpu interrupt request is generated when the ctof bit is set. reset clears this bit. rtie real-time interrupt enable when this bit is set, a cpu interrupt request is generated when the rtif bit is set. reset clears this bit. $08 bit 7 654321 bit 0 read: ctof rtif tofe rtie 00 rt1 rt0 write tofc rtfc reset: 00000011 = unimplemented figure 8-2. core timer status and control register (ctscr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required core timer general release specification mc68HC05V12 rev. 1.0 core timer tofc timer overflow flag clear when a 1 is written to this bit, ctof is cleared. writing a 0 has no effect on the ctof bit. this bit always reads as zero. rtfc real-time interrupt flag clear when a 1 is written to this bit, rtif is cleared. writing a 0 has no effect on the rtif bit. this bit always reads as zero. rt1Crt0 real-time interrupt rate select these two bits select one of four taps from the real-time interrupt circuit. see table 8-1 which shows the available interrupt rates with a 2.1 and 1.05 mhz bus clock. reset sets bits rt1 and rt0, which selects the lowest periodic rate, and gives the maximum time in which to alter these bits if necessary. care should be taken when altering rt0 and rt1 if the timeout period is imminent or uncertain. if the selected tap is modified during a cycle in which the counter is switching, an rtif could be missed or an additional one could be generated. to avoid problems, the cop should be cleared before changing rti taps. table 8-1. rti and cop rates at 2.1 mhz rti rate rt1Crt0 minimum cop rates 2.1 mhz 1.05 mhz 2.1 mhz 1.05 mhz 0.97 ms 1.95 ms 2 11 /e 00 (2 14 C2 11 )/e 6.83 ms 13.65 ms 1.95 ms 3.90 ms 2 12 /e 01 (2 15 C2 12 )/e 13.65 ms 27.31 ms 3.90 ms 7.80 ms 2 13 /e 10 (2 16 C2 13 )/e 27.31 ms 54.61 ms 7.80 ms 15.60 ms 2 14 /e 11 (2 17 C2 14 )/e 54.61 ms 109.23 ms f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
core timer computer operating properly (cop) reset mc68HC05V12 rev. 1.0 general release specification core timer non-disclosure agreement required 8.4 computer operating properly (cop) reset the cop watchdog timer function is implemented on this device by using the output of the rti circuit and further dividing it by eight. the minimum cop reset rates are listed in figure 8-1 . if the cop circuit times out, an internal reset is generated and the normal reset vector is fetched. preventing a cop timeout, or clearing the cop, is accomplished by writing a 0 to bit 0 of address $3ff0. when the cop is cleared, only the final divide-by-eight stage (output of the rti) is cleared. the cop time out period will vary depending on when the cop is feed with respect to the rti output clock. if the cop watchdog timer is allowed to time out, an internal reset is generated to reset the mcu. in addition the reset pin will be pulled low for a minimum of 3 e clock cycles for emulation purposes. during a chip reset (regardless of the source), the entire core timer counter chain is cleared. the cop will remain enabled after execution of the wait instruction and all associated operations apply. if the stop instruction is disabled, execution of stop instruction will cause an internal reset. this cops objective is to make it impossible for this part to become stuck or locked-up and to be sure the cop is able to rescue the part from any situation where it might entrap itself in an abnormal or unintended behavior. this function is a mask option. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required core timer general release specification mc68HC05V12 rev. 1.0 core timer 8.5 core timer counter register the core timer counter register (ctcr) is a read-only register which contains the current value of the 8-bit ripple counter at the beginning of the timer chain. this counter is clocked by the cpu clock (e/4) and can be used for various functions including a software input capture. extended time periods can be attained using the tof function to increment a temporary ram storage location, thereby simulating a 16- bit (or more) counter. the power-on cycle clears the entire counter chain and begins clocking the counter. after 4064 cycles, the power-on reset circuit is released which again clears the counter chain and allows the device to come out of reset. at this point, if reset is not asserted, the timer will start counting up from zero and normal device operation will begin. when reset is asserted any time during operation (other than por), the counter chain will be cleared. 8.6 core timer during wait mode the cpu clock halts during wait mode, but the timer remains active. if interrupts are enabled, a timer interrupt will cause the processor to exit wait mode. the cop watchdog timer, derived from the core timer, remains active in wait mode, if enabled via the mor. $09 bit 7 654321 bit 0 read: tmr7 tmr6 tmr5 tmr4 tmr3 tmr2 tmr1 tmr0 write: reset: 00000000 = unimplemented figure 8-3. core timer counter register (ctcr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
16-bit timer contents mc68HC05V12 rev. 1.0 general release specification 16-bit timer non-disclosure agreement required 9.1 contents 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 9.3 timer counter registers $18 - $19 and $1a - $1b. . . . . . . . . . .90 9.4 output compare register $16 - $17 . . . . . . . . . . . . . . . . . . . . .92 9.5 input capture register $14 - $15. . . . . . . . . . . . . . . . . . . . . . . .92 9.6 16-bit timer control register . . . . . . . . . . . . . . . . . . . . . . . . . .94 9.7 16-bit timer status register (tmrsr) . . . . . . . . . . . . . . . . . .95 9.8 16-bit timer during wait mode . . . . . . . . . . . . . . . . . . . . . . . . .96 9.9 16-bit timer during stop mode. . . . . . . . . . . . . . . . . . . . . . . . .96 9.2 introduction the timer consists of a 16-bit, free-running counter driven by a fixed divide-by-four prescaler. this timer can be used for many purposes, including input waveform measurements while simultaneously generating an output waveform. pulse widths can vary from several microseconds to many seconds. see figure 9-1 . because the timer has a 16-bit architecture, each specific functional segment (capability) is represented by two registers. these registers contain the high and low bytes of that functional segment. access of the high byte inhibits that specific timer function until the low byte is also accessed. note: the i bit in the ccr should be set while manipulating both the high and low byte registers of a specific timer function to ensure that an interrupt does not occur. general release specification mc68HC05V12 section 9. 16-bit timer f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required 16-bit timer general release specification mc68HC05V12 rev. 1.0 16-bit timer figure 9-1. 16-bit timer block diagram 9.3 timer counter registers $18 - $19 and $1a - $1b the key element in the programmable timer is a 16-bit, free-running counter or counter register preceded by a prescaler that divides the internal processor clock by four. the prescaler gives the timer a resolution of 2.0 microseconds if the internal bus clock is 2.0 mhz. the counter is incremented during the low portion of the internal bus clock. software can read the counter at any time without affecting its value. the double-byte, free-running counter can be read from either of two locations, $18-$19 (counter register) or $1a-$1b (counter alternate register). a read from only the least significant byte (lsb) of the free- running counter ($19, $1b) receives the count value at the time of the read. if a read of the free-running counter or counter alternate register input capture register clock internal bus output compare register high low byte $16 $17 ??? /4 internal processor 16-bit free- running counter counter alternate register low byte $1a $1b $18 $19 high byte low byte $14 $15 output compare circuit overflow detect circuit edge detect circuit timer status register icf ocf tof $13 icie iedg olvl output level register reset timer control register $12 output level (tcmp) interrupt circuit toie ocie edge input (tcap) d clk c q pb6 pb7 byte 8-bit buffer high byte f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
16-bit timer timer counter registers $18 - $19 and $1a - $1b mc68HC05V12 rev. 1.0 general release specification 16-bit timer non-disclosure agreement required first addresses the most significant byte (msb) ($18, $1a), the lsb ($19, $1b) is transferred to a buffer. this buffer value remains fixed after the first msb read, even if the user reads the msb several times. this buffer is accessed when reading the free-running counter or counter alternate register lsb ($19 or $1b) and, thus, completes a read sequence of the total counter value. in reading either the free-running counter or counter alternate register, if the msb is read, the lsb also must be read to complete the sequence. the counter alternate register differs from the counter register in one respect: a read of the counter register msb can clear the timer overflow flag (tof). therefore, the counter alternate register can be read at any time without the possibility of missing timer overflow interrupts due to clearing of the tof. the free-running counter is configured to $fffc during reset and is a read-only register only when the timer is enabled. during a power-on reset, the counter also is preset to $fffc and begins running only after the ton bit in the timer control register is set. because the free-running counter is 16 bits preceded by a fixed divided-by-four prescaler, the value in the free-running counter repeats every 262,144 internal bus clock cycles. when the counter rolls over from $ffff to $0000, the tof bit is set. when counter roll-over occurs, an interrupt also can be enabled by setting its interrupt enable bit (toie). note: to ensure that an interrupt does not occur, the i bit in the ccr should be set while manipulating both the high and low byte registers of a specific timer function. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required 16-bit timer general release specification mc68HC05V12 rev. 1.0 16-bit timer 9.4 output compare register $16 - $17 the 16-bit output compare register is made up of two 8-bit registers at locations $16 (msb) and $17 (lsb). the output compare register is used for several purposes, such as indicating when a period of time has elapsed. all bits are readable and writable and are not altered by the timer hardware or reset. if the compare function is not needed, the two bytes of the output compare register can be used as storage locations. the output compare register contents are continually compared with the contents of the free-running counter. if a match is found, the corresponding output compare flag (ocf) bit is set and the corresponding output level (olvl) bit is clocked to an output level register. the output compare register values and the output level bit should be changed after each successful comparison to establish a new elapsed timeout. an interrupt can also accompany a successful output compare provided the corresponding interrupt enable bit (ocie) is set. after a processor write cycle to the output compare register containing the msb ($16), the output compare function is inhibited until the lsb ($17) is also written. the user must write both bytes (locations) if the msb is written first. a write made only to the lsb ($17) will not inhibit the compare function. the free-running counter is updated every four internal bus clock cycles. the minimum time required to update the output compare register is a function of the program rather than the internal hardware. the processor can write to either byte of the output compare register without affecting the other byte. the output level (olvl) bit is clocked to the output level register regardless of whether the output compare flag (ocf) is set or clear. 9.5 input capture register $14 - $15 two 8-bit registers, which make up the 16-bit input capture register, are read-only and are used to latch the value of the free-running counter after the corresponding input capture edge detector senses a defined transition. the level transition which triggers the counter transfer is f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
16-bit timer input capture register $14 - $15 mc68HC05V12 rev. 1.0 general release specification 16-bit timer non-disclosure agreement required defined by the corresponding input edge bit (iedg). reset does not affect the contents of the input capture register. the result obtained by an input capture will be one more than the value of the free-running counter on the rising edge of the internal bus clock preceding the external transition. this delay is required for internal synchronization. resolution is one count of the free-running counter, which is four internal bus clock cycles. the free-running counter contents are transferred to the input capture register on each proper signal transition regardless of whether the input capture flag (icf) is set or clear. the input capture register always contains the free-running counter value that corresponds to the most recent input capture. after a read of the input capture register msb ($14), the counter transfer is inhibited until the lsb ($15) is also read. this characteristic causes the time used in the input capture software routine and its interaction with the main program to determine the minimum pulse period. a read of the input capture register lsb ($15) does not inhibit the free-running counter transfer since they occur on opposite edges of the internal bus clock. figure 9-2. tcap timing note: the input capture pin (tcap) and the output compare pin (tcmp) are shared with pb7 and pb6 respectively. the timers tcap input always is connected to pb7. pb6 is the timers tcmp pin if the oce bit in the miscellaneous control register is set. tcap t tltl t tl t th see control timing specifications for tcap timing requirements. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required 16-bit timer general release specification mc68HC05V12 rev. 1.0 16-bit timer 9.6 16-bit timer control register the 16-bit timer control register (tmrcr) is a read/write register containing six control bits. three bits control interrupts associated with the timer status register flags icf, ocf, and tof. icie C input capture interrupt enable 1 = interrupt enabled 0 = interrupt disabled ocie C output compare interrupt enable 1 = interrupt enabled 0 = interrupt disabled toie C timer overflow interrupt enable 1 = interrupt enabled 0 = interrupt disabled ton C timer on when disabled, the timer is initialized to the reset condition. 1 = timer enabled 0 = timer disabled iedg C input edge value of input edge determines which level transition on tcap pin will trigger free-running counter transfer to the input capture register. reset clears this bit. 1 = positive edge 0 = negative edge $12 bit 7 654321 bit 0 read: icie ocie toie 00 ton iedg olvl write: reset: 00000000 = unimplemented figure 9-3. timer control register (tmrcr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
16-bit timer 16-bit timer status register (tmrsr) mc68HC05V12 rev. 1.0 general release specification 16-bit timer non-disclosure agreement required olvl - output level value of output level is clocked into output level register by the next successful output compare and will appear on the tcmp pin. 1 = high output 0 = low output 9.7 16-bit timer status register (tmrsr) the 16-bit timer status register (tmrsr) is a read-only register containing three status flag bits. icf C input capture flag 1 = flag set when selected polarity edge is sensed by input capture edge detector 0 = flag cleared when tmrsr and input capture low register ($15) are accessed ocf C output compare flag 1 = flag set when output compare register contents match the free- running counter contents 0 = flag cleared when tmrsr and output compare low register ($17) are accessed tof C timer overflow flag 1 = flag set when free-running counter transition from $ffff to $0000 occurs 0 = flag cleared when tmrsr and counter low register ($19) are accessed $13 bit 7 654321 bit 0 read: icf ocf tof 00000 write: reset: 00000000 = unimplemented figure 9-4. timer status register (tmrsr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required 16-bit timer general release specification mc68HC05V12 rev. 1.0 16-bit timer accessing the timer status register satisfies the first condition required to clear status bits. the remaining step is to access the register corresponding to the status bit. a problem can occur when using the timer overflow function and reading the free-running counter at random times to measure an elapsed time. without incorporating the proper precautions into software, the timer overflow flag could unintentionally be cleared if: 1. the timer status register is read or written when tof is set, and 2. the msb of the free-running counter is read but not for the purpose of servicing the flag. the counter alternate register at address $1a and $1b contains the same value as the free-running counter (at address $18 and $19); therefore, this alternate register can be read at any time without affecting the timer overflow flag in the timer status register. 9.8 16-bit timer during wait mode the cpu clock halts during wait mode, but the timer remains active if turned on prior to entering wait mode. if interrupts are enabled, a timer interrupt will cause the processor to exit wait mode. 9.9 16-bit timer during stop mode in stop mode, the timer stops counting and holds the last count value if stop mode is exited by an interrupt. if reset is used, the counter is forced to $fffc. during stop, if the timer is on and at least one valid input capture edge occurs at the tcap pin, the input capture detect circuit is armed. this does not set any timer flags or wake up the mcu, but when the mcu does wake up, there is an active input capture flag and data from the first valid edge that occurred during stop mode. if reset is used to exit stop mode, then no input capture flag or data remains, even if a valid input capture edge occurred. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification serial peripheral interface (spi) non-disclosure agreement required general release specification mc68HC05V12 section 10. serial peripheral interface (spi) 10.1 contents 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 10.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 10.4 spi signal description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 10.4.1 slave select (ss/pb0) . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 10.4.2 serial clock (sck/pb1). . . . . . . . . . . . . . . . . . . . . . . . . . .100 10.4.3 master in slave out (miso/pb2) . . . . . . . . . . . . . . . . . . .100 10.4.4 master out slave in (mosi/pb3) . . . . . . . . . . . . . . . . . . .100 10.5 spi functional description . . . . . . . . . . . . . . . . . . . . . . . . . . .101 10.6 spi registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 10.6.1 serial peripheral control register. . . . . . . . . . . . . . . . . . .103 10.6.2 serial peripheral status register . . . . . . . . . . . . . . . . . . .104 10.6.3 serial peripheral data register. . . . . . . . . . . . . . . . . . . . .106 10.7 spi in stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 10.8 spi in wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 10.2 introduction the serial peripheral interface (spi) allows several mc68hc05 mcus or an mc68hc05 mcu plus peripheral devices to be interconnected within a single printed circuit board. in an spi, separate wires are required for data and clock. in the spi format, the clock is not included in the data stream and must be furnished as a separate signal. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required serial peripheral interface (spi) general release specification mc68HC05V12 rev. 1.0 serial peripheral interface (spi) 10.3 features ? full duplex, 3-wire synchronous transfers ? master or slave operation ? internal mcu clock divided by two (maximum) master bit frequency ? internal mcu clock (maximum) slave bit frequency ? four programmable master bit rates ? programmable clock polarity and phase ? end of transmission interrupt flag ? write collision flag protection ? master-master mode fault protection capability 10.4 spi signal description the four pins (mosi, miso, sck, and ss) are described in the following paragraphs. each signal function is described for both the master and slave modes. to function properly, the spi forces the direction on some of the pins to output. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
serial peripheral interface (spi) spi signal description mc68HC05V12 rev. 1.0 general release specification serial peripheral interface (spi) non-disclosure agreement required figure 10-1. data clock timing diagram 10.4.1 slave select ( ss/pb0) the slave select ( ss) pin is used to select the mcu as a slave device. it has to be low prior to data transactions and must stay low for the duration of the transaction. the ss pin on the master must be set high. if it goes low, a mode fault error flag (modf) is set in the spsr. when cpha = 0, the shift clock is the or of ss with sck. in this clock phase mode, ss must go high between successive characters in an spi message. when cpha = 1, ss may be left low for several spi characters. in cases where there is only one spi slave mcu, its ss pin could be set low as long as cpha = 1 clock modes are used. note: if the spi is in master mode, this pin can be used as a general-purpose output pin. if configured as an input pin while in master mode, it must be set high. internal strobe for data capture (all modes) msb6543210 ss sck sck sck sck miso/mosi (cpol = 0, cpha = 0) (cpol = 0, cpha = 1) (cpol = 1, cpha = 0) (cpol = 1, cpha = 1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required serial peripheral interface (spi) general release specification mc68HC05V12 rev. 1.0 serial peripheral interface (spi) 10.4.2 serial clock (sck/pb1) the master clock is used to synchronize data movement both in and out of the device through its mosi and miso lines. the master and slave devices are capable of exchanging a byte of information during a sequence of eight clock cycles. since sck is generated by the master device, this line becomes an input on a slave device. as shown in figure 10-1 , four possible timing relationships may be chosen by using control bits cpol and cpha in the serial peripheral control register (spcr). both master and slave devices must operate with the same timing. the master device always places data on the mosi line a half cycle before the clock edge (sck) for the slave device to latch the data. two bits (spr0 and spr1) in the spcr of the master device select the clock rate. in a slave device, spr0 and spr1 have no effect on the operation of the spi. 10.4.3 master in slave out (miso/pb2) the miso line is configured as an input in a master device and as an output in a slave device. it is one of the two lines that transfer serial data in one direction, with the most significant bit sent first. the miso line of a slave device is placed in the high-impedance state if the slave is not selected. 10.4.4 master out slave in (mosi/pb3) the mosi line is configured as an output in a master device and as an input in a slave device. it is one of the two lines that transfer serial data in one direction with the most significant bit sent first. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
serial peripheral interface (spi) spi functional description mc68HC05V12 rev. 1.0 general release specification serial peripheral interface (spi) non-disclosure agreement required 10.5 spi functional description figure 10-2 shows a block diagram of the serial peripheral interface circuitry. when a master device transmits data to a slave via the mosi line, the slave device responds by sending data to the master device via the masters miso line. this implies full duplex transmission with both data out and data in synchronized with the same clock signal. thus, the byte transmitted is replaced by the byte received and eliminates the need for separate transmit-empty and receive-full status bits. a single status bit (spif) is used to signify that the i/o operation has been completed. the spi is double buffered on read, but not on write. if a write is performed during data transfer, the transfer occurs uninterrupted, and the write will be unsuccessful. this condition will cause the write collision (wcol) status bit in the spsr to be set. after a data byte is shifted, the spif flag of the spsr is set. in the master mode, the sck pin is an output. it idles high or low, depending on the cpol bit in the spcr, until data is written to the shift register, at which point eight clocks are generated to shift the eight bits of data and then sck goes idle again. in a slave mode, the slave select start logic receives a logic low from the ss pin and a clock at the sck pin. thus, the slave is synchronized with the master. data from the master is received serially at the mosi line and loads the 8-bit shift register. after the 8-bit shift register is loaded, its data is parallel transferred to the read buffer. during a write cycle, data is written into the shift register, then the slave waits for a clock train from the master to shift the data out on the slaves miso line. figure 10-3 illustrates the mosi, miso, sck, and ss master-slave interconnections. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required serial peripheral interface (spi) general release specification mc68HC05V12 rev. 1.0 serial peripheral interface (spi) figure 10-2. serial peripheral interface block diagram figure 10-3. serial peripheral interface master-slave interconnection divider ? 2 ? 4 ? 16 ? 32 select 8-bit shift reg read data buff msb lsb s m m s s m pin control logic clock clock logic spi clock mstr spe spie spe mstr cpha cpol spr1 spr0 spi control register internal data bus spi interrupt request spi status register spr1 spr0 spi control spif wcol modf i nternal mcu clock pb1/ pb3 / pb2/ miso mosi sck (master) pb0 / ss 8-bit shift register 8-bit shift register miso mosi miso mosi spi clock generator sck sck slave master f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
serial peripheral interface (spi) spi registers mc68HC05V12 rev. 1.0 general release specification serial peripheral interface (spi) non-disclosure agreement required 10.6 spi registers three registers in the spi provide control, status, and data storage functions. these registers are called the serial peripheral control register (spcr), serial peripheral status register (spsr), and serial peripheral data i/o register (spdr) and are described in the following paragraphs. 10.6.1 serial peripheral control register spie - serial peripheral interrupt enable 1 = spi interrupt if spif = 1 0 = spif interrupts disabled spe - serial peripheral system enable 1 = spi system on; port b becomes spi pins. 0 = spi system off mstr - master mode select 1 = master mode 0 = slave mode cpol - clock polarity when the clock polarity bit is cleared and data is not being transferred, a steady state low value is produced at the sck pin of the master device. conversely, if this bit is set, the sck pin will idle high. this bit is also used in conjunction with the clock phase control bit to produce the desired clock-data relationship between master and slave. see figure 10-1 . $0a bit 7 654321 bit 0 read: spie spe 0 mstr cpol cpha spr1 spr0 write: reset: 000001uu = unimplemented u = unaffected figure 10-4. spi control register (spcr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required serial peripheral interface (spi) general release specification mc68HC05V12 rev. 1.0 serial peripheral interface (spi) cpha - clock phase the clock phase bit, in conjunction with the cpol bit, controls the clock-data relationship between master and slave. the cpol bit can be thought of as simply inserting an inverter in series with the sck line. the cpha bit selects one of two fundamentally different clocking protocols. when cpha = 0, the shift clock is the or of sck with ss. as soon as ss goes low, the transaction begins and the first edge on sck invokes the first data sample. when cpha = 1, ss may be thought of as a simple output enable control. see figure 10-1 . spr1 and spr0 - spi clock rate selects these two bits select one of four baud rates (see table 10-1 ) to be used as sck if the device is a master; however, they have no effect in slave mode. 10.6.2 serial peripheral status register table 10-1. serial peripheral rate selection spr1 spr0 internal mcu clock divided by 00 2 01 4 10 16 11 32 $0b bit 7 654321 bit 0 read: spif wcol 0 modf 0000 write: reset: 00000000 = unimplemented figure 10-5. spi status register (spsr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
serial peripheral interface (spi) spi registers mc68HC05V12 rev. 1.0 general release specification serial peripheral interface (spi) non-disclosure agreement required spif - spi transfer complete flag the serial peripheral data transfer flag bit is set upon completion of data transfer between the processor and external device. if spif goes high, and if spie is set, a serial peripheral interrupt is generated. clearing the spif bit is accomplished by reading the spsr (with spif set) followed by an access of the spdr. unless spsr is read (with spif set) first, attempts to write to spdr are inhibited. wcol - write collision the write collision bit is set when an attempt is made to write to the serial peripheral data register while data transfer is taking place. if cpha is zero, a transfer is said to begin when ss goes low and the transfer ends when ss goes high after eight clock cycles on sck. when cpha is one, a transfer is said to begin the first time sck becomes active while ss is low and the transfer ends when the spif flag gets set. clearing the wcol bit is accomplished by reading the spsr (with wcol set) followed by an access to spdr. modf - mode fault the mode fault flag indicates that there may have been a multi-master conflict for system control and allows a proper exit from system operation to a reset or default system state. the modf bit is normally clear, and is set only when the master device has its ss pin set low. setting the modf bit affects the internal serial peripheral interface system in these ways: 1. an spi interrupt is generated if spie = 1. 2. the spe bit is cleared, disabling the spi. 3. the mstr bit is cleared, thus forcing the device into the slave mode. clearing the modf bit is accomplished by reading the spsr (with modf set), followed by a write to the spcr. control bits spe and mstr may be restored by user software to their original state after the modf bit has been cleared. it is also necessary to restore the port b ddr bits after a mode fault. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required serial peripheral interface (spi) general release specification mc68HC05V12 rev. 1.0 serial peripheral interface (spi) 10.6.3 serial peripheral data register the serial peripheral data i/o register is used to transmit and receive data on the serial bus. only a write to this register will initiate transmission/reception of another byte, and this will only occur in the master device. at the completion of transmitting a byte of data, the spif status bit is set in both the master and slave devices. when the user reads the serial peripheral data i/o register, a buffer is actually being read. the first spif must be cleared by the time a second transfer of the data from the shift register to the read buffer is initiated or an overrun condition will exist. in cases of overrun, the byte which causes the overrun is lost. a write to the serial peripheral data i/o register is not buffered and places data directly into the shift register for transmission. $0c bit 7 654321 bit 0 read: spd7 spd6 spd5 spd4 spd3 spd2 spd1 spd0 write: reset: unaffected by reset figure 10-6. spi data register (spdr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
serial peripheral interface (spi) spi in stop mode mc68HC05V12 rev. 1.0 general release specification serial peripheral interface (spi) non-disclosure agreement required 10.7 spi in stop mode when the mcu enters stop mode, the baud rate generator driving the spi shuts down. this essentially stops all master mode spi operation; thus, the master spi is unable to transmit or receive any data. if the stop instruction is executed during an spi transfer, that transfer is halted until the mcu exits stop mode (provided it is an exit resulting from a viable interrupt source). if the stop mode is exited by a reset, then the appropriate control/status bits are cleared and the spi is disabled. if the device is in slave mode when the stop instruction is executed, the slave spi will still operate. it can still accept data and clock information in addition to transmitting its own data back to a master device. at the end of a possible transmission with a slave spi in stop mode, no flags are set until a viable interrupt results in an mcu wake up. be cautious when operating the spi (as a slave) during stop mode because none of the protection circuitry (write collision, mode fault, etc.) is active. also note that when the mcu enters stop mode, all enabled output drivers (miso, mosi, and sclk ports) remain active and any sourcing currents from these outputs will be part of the total supply current required by the device. 10.8 spi in wait mode the spi subsystem remains active in wait mode. therefore, it is consuming power. before reducing power, the spi should be shut off prior to entering wait mode. a non-reset exit from wait mode will result in the state of the spi being unchanged. a reset exit will return the spi to its reset state, which is disabled. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required serial peripheral interface (spi) general release specification mc68HC05V12 rev. 1.0 serial peripheral interface (spi) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification pulse width modulators (pwms) non-disclosure agreement required general release specification mc68HC05V12 section 11. pulse width modulators (pwms) 11.1 contents 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109 11.3 pwm functional description . . . . . . . . . . . . . . . . . . . . . . . . .110 11.4 pwm registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112 11.4.1 pwma control register . . . . . . . . . . . . . . . . . . . . . . . . . .113 11.4.2 pwmb control register . . . . . . . . . . . . . . . . . . . . . . . . . .114 11.4.3 pwma data register . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 11.4.4 pwmb data register . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 11.5 pwms during wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 11.6 pwms during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 11.7 pwms during reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 11.2 introduction the pulse width modulator (pwm) system has two 6-bit pwms (pwma and pwmb). preceding the 6-bit ( ? 64) counters are two programmable prescalers.the pwm frequency is selected by choosing the desired divide option from the programmable prescalers. note that the pwm clock input is f op . the pwm frequency will be f op /(psa*(psb-1)*64) where psa and psb are the values selected by the a and b prescaler and 64 comes from the 6-bit modulus counter. see table 11-1 for precise values. the f op is the internal bus frequency fixed to half of the external oscillator frequency. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required pulse width modulators (pwms) general release specification mc68HC05V12 rev. 1.0 pulse width modulators (pwms) figure 11-1. pwm block diagram 11.3 pwm functional description the pwm is capable of generating signals from 0% to 100% duty cycle. a $00 in the pwm data register yields a low output (0%), but a $3f yields a duty of 63/64. to achieve the 100% duty (high output), the polarity control bit is set to zero while the data register has $00 in it. when not in use, the pwm system can be shut off to save power by clearing the clock rate select bits psa0x and psa1x in pwm control registers. writes to the pwm data registers are buffered and can, therefore, be performed at any time without affecting the output signal. when the pwm subsystem is enabled, a write to the pwm control register will become effective immediately. when the pwm subsystem is enabled, a write to the pwm data register will not become effective until the end of the current pwm period has 6-bit counter ( ? 64 ) pwm data register modulus and comparator pwmx pin logic pwmx ? 1 , ? 8 , ? 16 f op (cpu bus clock) psa0x psa1x pwm control registers and buffers hc05 data bus polx pwm data buffer sclk ? 1C16 psb2x psb3x psb0x psb1x rclk integer divide f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
pulse width modulators (pwms) pwm functional description mc68HC05V12 rev. 1.0 general release specification pulse width modulators (pwms) non-disclosure agreement required occurred, at which time the new data value is loaded into the pwm data register. however, should a write to the registers be performed when the pwm subsystem is disabled, the data is transferred immediately. all registers are updated after the pwm data register is written to and the end of a pwm cycle occurs. the pwm output can have an active high or an active low pulse under software control using the pol (polarity) bit as shown in figure 11-2 and figure 11-3 . figure 11-2. pwm waveform examples (pol = 1) figure 11-3. pwm waveform examples (pol = 0) $05 $3f $1f pwm register = $00 t $05 $1f pwm register = $00 t $3f f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required pulse width modulators (pwms) general release specification mc68HC05V12 rev. 1.0 pulse width modulators (pwms) 11.4 pwm registers associated with each pwm system, there is a pwm data register and a control register. these registers can be written to and read at any time. data written to the data register is held in a buffer and transferred to the pwm data register at the end of a pwm cycle. reads of this register will always result in the read of the pwm data register and not the buffer. upon reset the user should write to the data register prior to enabling the pwm system (for example, prior to setting the psax and psbx bits for pwm input clock rate). this will avoid an erroneous duty cycle from being driven. during user mode, the user should write to the pwm data register after writing the pwm control register. figure 11-4. pwm write sequences initialize pwm data 0 write pwm control or reset por write pwm control write pwm data 1 n y f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
pulse width modulators (pwms) pwm registers mc68HC05V12 rev. 1.0 general release specification pulse width modulators (pwms) non-disclosure agreement required 11.4.1 pwma control register psa1a, psa0a, psb3a - psb0a pwma clock rate bits these bits select the input clock rate and determine the period as shown in table 11-1 . note that some output frequencies can be obtained with more than one combination of psa and psb values. for instance, a pwma output of f op /512 can be obtained with either psa - psa0 = 10 and psb3 - psb0 = $0 or psa1 - psa0 = 01 and psb3 - psb0 = $07. the frequency division provided by the psb values will be one more that the value written to the register. for example, a $0 written to the psb bits provides a ? 1 and a $1 provides a ? 2 , etc. this scheme allows for 38 unique frequency selections. note: any non-zero value of psa1a - psa0a forces pb4 to the pwma output state. if psa1a:psa0a = 00, pb4 is determined by the port b data and data direction registers as described in section 7. parallel input/output (i/o) . $37 bit 7 654321 bit 0 read: psa1a psa0a 00 psb3a psb2a psb1a psb0a write: reset: 00000000 = unimplemented figure 11-5. pwma control register (pwmac) table 11-1. pwma clock rates psa1aC psa0a psb3aC psb0a rclka sclka pwma out 00 xxxx off off off 01 0000C1111 f op /1 f op /1Cf op /16 f op /64Cf op /1024 10 0000C1111 f op /8 f op /8Cf op /128 f op /512Cf op /8192 11 0000C1111 f op /16 f op /16Cf op /256 f op /1024Cf op /16384 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required pulse width modulators (pwms) general release specification mc68HC05V12 rev. 1.0 pulse width modulators (pwms) 11.4.2 pwmb control register psa1b, psa0b, and psb3b - psb0b pwm clock rate these bits select the input clock rate for pwmb and determine the period as shown in table 11-2 . these bits function exactly the same as the corresponding bits in the pwma control register except they affect the pwmb output pin. note: any non-zero value of psa1b - psa0b forces pb5 to the pwmb output state. if psa1b - psa0b = 00, pb5 is determined by the port b data and data direction registers as described in section 7. parallel input/output (i/o) . $39 bit 7 654321 bit 0 read: psa1b psa0b 00 psb3b psb2b psb1b psb0b write: reset: 00000000 = unimplemented figure 11-6. pwmb control register (pwmbc) table 11-2. pwmb clock rates psa1bC psa0b psb3bC psb0b rclkb sclkb pwmb out 00 xxxx off off off 01 0000C1111 f op /1 f op /1Cf op /16 f op /64Cf op /1024 10 0000C1111 f op /8 f op /8Cf op /128 f op /512Cf op /8192 11 0000C1111 f op /16 f op /16Cf op /256 f op /1024Cf op /16384 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
pulse width modulators (pwms) pwm registers mc68HC05V12 rev. 1.0 general release specification pulse width modulators (pwms) non-disclosure agreement required 11.4.3 pwma data register the pwma system has one 6-bit data register which holds the duty cycle information. the data bits in this register are unaffected by reset. a value of $00 in this register corresponds to a steady state output level (0% duty cycle) on the pwma pin. the logic level of the output will depend on the value of the pola bit in the pwma control register. pola pwma polarity 1 = pwma pulse is active high. 0 = pwma pulse is active low. 11.4.4 pwmb data register the pwmb system has one 6-bit data register which holds the duty cycle information. these bits work the same way as the data bits in the pwma data register except they affect the pwmb output pin. the data bits in this register are unaffected by reset. polb pwmb polarity 1 = pwmb pulse is active high. 0 = pwmb pulse is active low. $36 bit 7 654321 bit 0 read: pola 0 d5 d4 d3 d2 d1 d0 write: reset: 0 0 uuuuuu = unimplemented u = unaffected figure 11-7. pwma data register $38 bit 7 654321 bit 0 read: polb 0 d5 d4 d3 d2 d1 d0 write: reset: 0 0 uuuuuu = unimplemented u = unaffected figure 11-8. pwmb data register f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required pulse width modulators (pwms) general release specification mc68HC05V12 rev. 1.0 pulse width modulators (pwms) 11.5 pwms during wait mode the pwm continues normal operation during wait mode. to decrease power consumption during wait mode, it is recommended that the rate select bits in the pwm control registers be cleared if the pwm is not being used. 11.6 pwms during stop mode in stop mode, the oscillator is stopped causing the pwm to cease functioning. any signal in process is aborted in whatever phase the signal happens to be in. 11.7 pwms during reset upon reset the psa0x and psa1x bits in pwmx control registers are cleared. this disables the pwm system and sets the pwm outputs low. the user should write to the data registers prior to enabling the pwm system (for example, prior to setting psa1x or psa0x). this will avoid an erroneous duty cycle from being driven. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification eeprom non-disclosure agreement required general release specification mc68HC05V12 section 12. eeprom 12.1 contents 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 12.3 eeprom programming register . . . . . . . . . . . . . . . . . . . . . .118 12.4 eeprom programming/erasing procedure. . . . . . . . . . . . . .120 12.5 operation in stop and wait modes. . . . . . . . . . . . . . . . . . . . .121 12.2 introduction the mc68HC05V12 contains eeprom memory. this section describes the programming mechanisms for eeprom memory. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required eeprom general release specification mc68HC05V12 rev. 1.0 eeprom 12.3 eeprom programming register the contents and use of the programming register are discussed here. note: any reset including lvr will abort any write in progress when it is asserted. data written to the addressed byte will, therefore, be indeterminate. cpen charge pump enable when set, cpen enables the charge pump which produces the internal programming voltage. this bit should be set with the eelat bit. the programming voltage will not be available until eepgm is set. the charge pump should be disabled when not in use. cpen is readable and writable and is cleared by reset. er1 - er0 erase select bits er1 and er0 form a 2-bit field which is used to select one of three erase modes: byte, block, or bulk. table 12-1 shows the modes selected for each bit configuration. these bits are readable and writable and are cleared by reset. in byte erase mode, only the selected byte is erased. in block mode, a 64-byte block of eeprom is erased. the eeprom memory space is divided into four 64-byte blocks ($0240-$027f, $0280-$02bf, $02c0-$02ff, and $0300-$033f), and doing a block erase to any address within a block will erase the entire block. in bulk erase mode, the entire 256 byte eeprom section is erased. $1c bit 7 654321 bit 0 read: 0 cpen 0 er1 er0 eelat eerc eepgm write: reset: 00000000 = unimplemented figure 12-1. eeprom programming register (eeprog) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
eeprom eeprom programming register mc68HC05V12 rev. 1.0 general release specification eeprom non-disclosure agreement required eelat eeprom programming latch when set, eelat configures the eeprom address and data bus for programming. when eelat is set, writes to the eeprom array cause the data bus and the address bus to be latched. this bit is readable and writable, but reads from the array are inhibited if the eelat bit is set and a write to the eeprom space has taken place. when clear, address and data buses are configured for normal operation. reset clears this bit. eerc eeprom rc oscillator control when this bit is set, the eeprom section uses the internal rc oscillator instead of the cpu clock. after setting the eerc bit, delay a time, t rcon , to allow the rc oscillator to stabilize. this bit is readable and writable and should be set by the user when the internal bus frequency falls below 1.5 mhz. reset clears this bit. eepgm eeprom programming power enable eepgm must be written to enable (or disable) the eepgm function. when set, eepgm turns on the charge pump and enables the programming (or erasing) power to the eeprom array. when clear, this power is switched off. this will enable pulsing of the programming voltage to be controlled internally. this bit can be read at any time, but can only be written to if eelat = 1. if eelat is not set, then eepgm cannot be set. reset clears this bit. table 12-1. erase mode select er1 er0 mode 0 0 no erase 0 1 byte erase 1 0 block erase 1 1 bulk erase f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required eeprom general release specification mc68HC05V12 rev. 1.0 eeprom 12.4 eeprom programming/erasing procedure to program a byte of eeprom, set eelat = cpen = 1, set er1 = er0 = 0, write data to the desired address, and then set eepgm for a time, t eepgm . in general, all bits should be erased before being programmed. however, if write/erase cycling is a concern, a procedure can be followed to minimize the cycling of each bit in each eeprom byte. the erased state is 1; therefore, if any bits within the byte need to be changed from a 0 to a 1, the byte must be erased before programming. the decision whether to erase a byte before programming is summarized in table 12-2 . to erase a byte of eeprom, set eelat = 1, cpen = 1, er1 = 0 and er0 = 1, write to the address to be erased, and set eepgm for a time, t ebyt . to erase a block of eeprom, set eelat = 1, cpen = 1, er1 = 1 and er0 = 0, write to any address in the block, and set eepgm for a time, t eblock . for a bulk erase, set eelat = 1, cpen = 1, er1 = 1, and er0 = 1, write to any address in the array, and set eepgm for a time, t ebulk . to terminate the programming or erase sequence, clear eepgm, delay for a time, t fpv, to allow the programming voltage to fall, and then clear eelat and cpen to free up the buses. following each erase or programming sequence, clear all programming control bits. table 12-2. eeprom write/erase cycle reduction eeprom data to be programed eeprom data before programming erase before programming? 00no 01no 10yes 11no f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
eeprom operation in stop and wait modes mc68HC05V12 rev. 1.0 general release specification eeprom non-disclosure agreement required 12.5 operation in stop and wait modes the rc oscillator for the eeprom is disabled automatically when entering stop mode. to help conserve power, the user should disable the rc oscillator before entering wait mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required eeprom general release specification mc68HC05V12 rev. 1.0 eeprom f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification a/d converter non-disclosure agreement required general release specification mc68HC05V12 section 13. a/d converter 13.1 contents 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 13.3 analog section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124 13.3.1 ratiometric conversion . . . . . . . . . . . . . . . . . . . . . . . . . . .124 13.3.2 v refh and v refl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124 13.3.3 accuracy and precision. . . . . . . . . . . . . . . . . . . . . . . . . . .124 13.3.4 conversion process . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124 13.4 digital section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 13.4.1 conversion times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 13.4.2 internal and master oscillators . . . . . . . . . . . . . . . . . . . . .125 13.4.3 multi-channel operation . . . . . . . . . . . . . . . . . . . . . . . . . .126 13.5 a/d status and control register. . . . . . . . . . . . . . . . . . . . . . .126 13.6 a/d data register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 13.7 a/d during wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128 13.8 a/d during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128 13.2 introduction the mc68HC05V12 includes a 5-channel, 8-bit, multiplexed input, and a successive approximation analog-to-digital (a/d) converter. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required a/d converter general release specification mc68HC05V12 rev. 1.0 a/d converter 13.3 analog section the following paragraphs describe the analog section. 13.3.1 ratiometric conversion the a/d is ratiometric, with two dedicated pins supplying the reference voltages (v refh and v refl ) . an input voltage equal to v refh converts to $ff (full scale) and an input voltage equal to v refl converts to $00. an input voltage greater than v refh will convert to $ff with no overflow indication. for ratiometric conversions, the source of each analog input should use v refh as the supply voltage and be referenced to v refl . 13.3.2 v refh and v refl the reference supply for the a/d is two dedicated pins rather than being driven by the system power supply lines. the voltage drops in the bonding wires of the heavily loaded system power pins would degrade the accuracy of the a/d conversion. v refh and v refl can be any voltage between v ssa and v cca , as long as v refh > v refl ; however, the accuracy of conversions is tested and guaranteed only for v refl = v ssa and v refh = v cca . 13.3.3 accuracy and precision the 8-bit conversions shall be accurate to within 1 lsb including quantization. 13.3.4 conversion process the a/d reference inputs are applied to a precision internal digital-to- analog (d/a) converter. control logic drives this d/a and the analog output is successively compared to the selected analog input which was sampled at the beginning of the conversion time. the conversion process is monotonic and has no missing codes. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
a/d converter digital section mc68HC05V12 rev. 1.0 general release specification a/d converter non-disclosure agreement required 13.4 digital section the following paragraphs describe the digital section. 13.4.1 conversion times each channel of conversion takes 32 clock cycles, which must be at a frequency equal to or greater than 1 mhz. 13.4.2 internal and master oscillators if the mcu bus (f op ) frequency is less than 1.0 mhz, an internal rc oscillator (nominally 1.5 mhz) must be used for the a/d conversion clock. this selection is made by setting the adrc bit in the a/d status and control registers to 1. in stop mode, the internal rc oscillator is turned off automatically, although the a/d subsystem remains enabled (adon remains set). in wait mode the a/d subsystem remains functional. see 13.7 a/d during wait mode . when the internal rc oscillator is being used as the conversion clock, three limitations apply: 1. the conversion complete flag (coco) must be used to determine when a conversion sequence has been completed, due to the frequency tolerance of the rc oscillator and its asynchronism with regard to the mcu bus clock. 2. the conversion process runs at the nominal 1.5 mhz rate, but the conversion results must be transferred to the mcu result registers synchronously with the mcu bus clock so conversion time is limited to a maximum of one channel per bus cycle. 3. if the system clock is running faster than the rc oscillator, the rc oscillator should be turned off and the system clock used as the conversion clock. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required a/d converter general release specification mc68HC05V12 rev. 1.0 a/d converter 13.4.3 multi-channel operation a multiplexer allows the a/d converter to select one of five external analog signals and four internal reference sources. 13.5 a/d status and control register the following paragraphs describe the function of the a/d status and control register. coco conversions complete this read-only status bit is set when a conversion is completed, indicating that the a/d data register contains valid results. this bit is cleared whenever the a/d status and control register is written and a new conversion automatically started, or whenever the a/d data register is read. once a conversion has been started by writing to the a/d status and control register, conversions of the selected channel will continue every 32 cycles until the a/d status and control register is written again. in this continuous conversion mode the a/d data register will be filled with new data, and the coco bit set, every 32 cycles. data from the previous conversion will be overwritten regardless of the state of the coco bit prior to writing. adrc rc oscillator control when adrc is set, the a/d section runs on the internal rc oscillator instead of the cpu clock. the rc oscillator requires a time, t rcon , to stabilize, and results can be inaccurate during this time. $1e bit 7 654321 bit 0 read: coco adrc adon ch4 ch3 ch2 ch1 ch0 write: reset: 00000000 = unimplemented figure 13-1. a/d status and control register (adscr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
a/d converter a/d data register mc68HC05V12 rev. 1.0 general release specification a/d converter non-disclosure agreement required adon a/d on when the a/d is turned on (adon = 1), it requires a time, t adon , for the current sources to stabilize, and results can be inaccurate during this time. this bit turns on the charge pump. ch4Cch0 channel select bits cn4, ch3, ch2, ch1, and ch0 form a 5-bit field which is used to select one of nine a/d channels, including four internal references. channels $0 - 4 correspond to port d input pins on the mcu. channels $10 - $13 are used for internal reference points. in single-chip mode, channel $13 is reserved and converts to $00. table 13-1 shows the signals selected by the channel select field. 13.6 a/d data register an 8-bit result register is provided. this register is updated each time the coco bit is set. table 13-1. a/d channel assignments ch4 C ch0 signal 00C04 ad0Cad4 $10 v refh $11 (v refh Cv refl )/2 $12 v refl $13 factory test $05 - $0f, $14 - $1f unused $1d bit 7 654321 bit 0 read: d7 d6 d5 d4 d3 d2 d1 d0 write: reset: unaffected by reset = unimplemented figure 13-2. a/d data register (addr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required a/d converter general release specification mc68HC05V12 rev. 1.0 a/d converter 13.7 a/d during wait mode the a/d converter continues normal operation during wait mode. to decrease power consumption during wait mode, it is recommended that both the adon and adrc bits in the a/d status and control registers be cleared if the a/d converter is not being used. if the a/d converter is in use and the system clock rate is above 1.0 mhz, it is recommended that the adrc bit be cleared. note: as the a/d converter continues to function normally in wait mode, the coco bit is not cleared. 13.8 a/d during stop mode in stop mode, the comparator and charge pump are turned off and the a/d ceases to function. any pending conversion is aborted. when the clocks begin oscillation upon leaving stop mode, a finite amount of time passes before the a/d circuits stabilize enough to provide conversions to the specified accuracy. normally, the delays built into the device when coming out of stop mode are sufficient for this purpose so that no explicit delays need to be built into the software. note: although the comparator and charge pump are disabled in stop mode, the a/d data and status/control registers are not modified. disabling the a/d prior to entering stop mode will not affect the stop mode current consumption. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required general release specification mc68HC05V12 section 14. byte data link controller-digital (bdlc-d) 14.1 contents 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131 14.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131 14.4 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132 14.5 bdlc operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133 14.5.1 power off mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134 14.5.2 reset mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134 14.5.3 run mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134 14.5.4 bdlc wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135 14.5.5 bdlc stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135 14.5.6 digital loopback mode . . . . . . . . . . . . . . . . . . . . . . . . . . .135 14.6 bdlc cpu interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135 14.6.1 bdlc control register 1. . . . . . . . . . . . . . . . . . . . . . . . . .136 14.6.2 bdlc control register 2. . . . . . . . . . . . . . . . . . . . . . . . . .138 14.6.3 bdlc state vector register . . . . . . . . . . . . . . . . . . . . . . .144 14.6.4 bdlc data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146 14.6.5 bdlc analog and roundtrip delay. . . . . . . . . . . . . . . . . .147 14.7 bdlc protocol handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150 14.7.1 protocol architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150 14.7.2 rx and tx shift registers . . . . . . . . . . . . . . . . . . . . . . . . .151 14.7.3 rx and tx shadow registers . . . . . . . . . . . . . . . . . . . . . .151 14.7.4 digital loopback multiplexer . . . . . . . . . . . . . . . . . . . . . . .151 14.7.5 state machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151 14.7.5.1 4x mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .152 14.7.5.2 receiving a message in block mode . . . . . . . . . . . . . . .152 14.7.5.3 transmitting a message in block mode . . . . . . . . . . . . .152 14.7.6 j1850 bus errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 14.7.6.1 crc error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 14.7.6.2 symbol error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) 14.7.6.3 framing error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 14.7.6.4 bus fault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153 14.7.6.5 break (break) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154 14.8 bdlc mux interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155 14.8.1 rx digital filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155 14.8.1.1 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156 14.8.1.2 performance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157 14.8.2 j1850 frame format. . . . . . . . . . . . . . . . . . . . . . . . . . . . .158 14.8.3 j1850 vpw symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . . .161 14.8.3.1 logic 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .161 14.8.3.2 logic 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .162 14.8.3.3 normalization bit (nb) . . . . . . . . . . . . . . . . . . . . . . . . . .163 14.8.3.4 start of frame symbol (sof) . . . . . . . . . . . . . . . . . . . .163 14.8.4 eod - end of data symbol. . . . . . . . . . . . . . . . . . . . . . . .163 14.8.4.1 end of frame symbol (eof) . . . . . . . . . . . . . . . . . . . . .163 14.8.4.2 inter-frame separation symbol (ifs) . . . . . . . . . . . . . .163 14.8.4.3 break signal (break) . . . . . . . . . . . . . . . . . . . . . . . . . .163 14.8.5 j1850 vpw valid/invalid bits and symbols . . . . . . . . . . .164 14.8.5.1 invalid passive bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . .165 14.8.5.2 valid passive logic 0 . . . . . . . . . . . . . . . . . . . . . . . . . . .165 14.8.5.3 valid passive logic 1 . . . . . . . . . . . . . . . . . . . . . . . . . . .166 14.8.5.4 valid eod symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . .166 14.8.5.5 valid eof and ifs symbol . . . . . . . . . . . . . . . . . . . . . .167 14.8.5.6 idle bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .167 14.8.5.7 invalid active bit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .168 14.8.5.8 valid active logic 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . .168 14.8.5.9 valid active logic 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . .168 14.8.5.10 valid sof symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . .168 14.8.5.11 valid break symbol . . . . . . . . . . . . . . . . . . . . . . . . . . .169 14.8.6 message arbitration . . . . . . . . . . . . . . . . . . . . . . . . . . . . .169 14.9 bdlc application notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171 14.9.1 initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171 14.9.2 bdlc stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171 14.9.3 bdlc wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .172 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) introduction mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required 14.2 introduction the byte data link controller (bdlc) provides access to an external serial communication multiplex bus, operating according to the sae j1850 protocol. 14.3 features bdlc module features include: ? sae j1850 class b data communications network interface compatible ? 10.4 kbps variable pulse width (vpw) bit format ? digital noise filter ? collision detection ? hardware cyclical redundancy check (crc) generation and checking ? two power-saving modes with automatic wakeup on network activity ? polling and cpu interrupts ? receive and transmit block modes supported ? supports 4x receive mode (41.6 kbps) ? digital loopback mode ? analog loopback mode ? in-frame response (ifr) types 0, 1, 2, and 3 supported f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) 14.4 functional description figure 14-1. bdlc block diagram the cpu interface contains the software addressable registers and provides the link between the cpu and the buffers. the buffers provide storage for data received and data to be transmitted onto the j1850 bus. the protocol handler is responsible for the encoding and decoding of data bits and special message symbols during transmission and reception. the mux interface provides the link between the bdlc digital section and the analog physical interface. the wave shaping, driving, and digitizing of data is performed by the physical interface. use of the bdlc module in message networking fully implements the sae standard j1850 class b data communication network interface specification . to cpu protocol handler mux interface cpu interface rx/tx buffers to j1850 transceiver bdlc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc operating modes mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required 14.5 bdlc operating modes the bdlc has five main modes of operation which interact with the power supplies, pins, and the rest of the mcu as shown in figure 14-2 . figure 14-2. bdlc operating modes state diagram v dd > v dd (min) and power off reset bdlc stop run v dd v dd (min) stop instruction or from any mode bdlc wait network activity or wait instruction and wcm = 1 wait instruction and wcm = 0 any mcu reset source asserted no mcu reset source asserted any mcu reset source asserted network activity or other mcu wakeup other mcu wakeup (cop, illaddr, pu, reset, lvr, por) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) 14.5.1 power off mode power off mode is entered from the reset mode whenever the bdlc supply voltage v dd drops below its minimum specified value for the bdlc to guarantee operation. the bdlc will be placed in the reset mode by low-voltage reset (lvr) before being powered down. in this mode, the pin input and output specifications are not guaranteed. 14.5.2 reset mode this mode is entered from the power off mode whenever the bdlc supply voltage v dd rises above its minimum specified value (v dd(min) ) and some mcu reset source is asserted. to prevent the bdlc from entering an unknown state, the internal mcu reset is asserted while powering up the bdlc. bdlc reset mode also is entered from any other mode as soon as one of the mcus possible reset sources (such as lvr, por, cop watchdog, reset pin, etc.) is asserted. in this mode, the internal bdlc voltage references are operative, v dd is supplied to the internal circuits, which are held in their reset state, and the internal bdlc system clock is running. registers will assume their reset condition. outputs are held in their programmed reset state and inputs and network activity are ignored. 14.5.3 run mode this mode is entered from reset mode after all mcu reset sources are no longer asserted. it is entered from bdlc wait mode whenever activity is sensed on the j1850 bus. run mode is entered from bdlc stop mode whenever network activity is sensed, although messages will not be received properly until the clocks have stabilized and the cpu is in the run mode also. in this mode, normal network operation takes place. the user should ensure that all bdlc transmissions have ceased before exiting this mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc cpu interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required 14.5.4 bdlc wait mode this power-conserving mode is entered automatically from run mode whenever the cpu executes a wait instruction and if the wcm bit in the bcr register is cleared previously. in this mode, the bdlc internal clocks continue to run, but the physical interface circuitry is placed in a low-power mode and waits for any activity on the bus. the first passive-to-active transition of the bus wakes up the bdlc and the cpu. if a valid byte is successfully received, a cpu interrupt request will be generated. 14.5.5 bdlc stop mode this power-conserving mode is entered automatically from run mode whenever the cpu executes a stop instruction or if the cpu executes a wait instruction and the wcm bit in the bcr register is set previously. in this mode, the bdlc internal clocks are stopped, but the physical interface circuitry is placed in a low-power mode and awaits network activity. if network activity is sensed, then a cpu interrupt request will be generated, restarting the bdlc internal clocks. 14.5.6 digital loopback mode when a bus fault has been detected, the digital loopback mode is used to determine if the fault condition is caused by failure in the nodes internal circuits or elsewhere in the network, including the nodes analog physical interface. in this mode, the receive digital input (rxpd) is connected to the transmit digital output (txpd) to form the loopback connection. txpd is not observable at the output pin. 14.6 bdlc cpu interface the cpu interface provides the interface between the cpu and the bdlc. it consists of five user registers. a full description of each register follows. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) 14.6.1 bdlc control register 1 this register is used to configure and control the bdlc. imsg ignore message this bit is used to disable the receiver until a new start of frame (sof) is detected. 1 = disable receiver. when set, all bdlc interrupt requests will be masked and the status bits will be held in their reset state. if this bit is set while the bdlc is receiving a message, the rest of the incoming message will be ignored. 0 = enable receiver. this bit is cleared automatically by the reception of an sof symbol or a break symbol. it will then generate interrupt requests and will allow changes of the status register to occur. however, these interrupts may still be masked by the interrupt enable (ie) bit. clks clock select the nominal bdlc operating frequency (f bdlc ) must always be 1.048576 mhz or 1 mhz for j1850 bus communications to take place. the clks register bit is provided to allow the user to indicate to the bdlc which frequency (1.048576 mhz or 1 mhz) is used so that each symbol time can be adjusted automatically. 1 = binary frequency (1.048576 mhz) is used for f bdlc . 0 = integer frequency (1 mhz) is used. for f bdlc. r1 and r0 rate select these bits determine the amount by which the frequency of the mcu system clock signal (f op ) is divided to form the mux interface clock (f bdlc ) which defines the basic timing resolution of the mux interface. $003a bit 7 654321 bit 0 read: imsg clks r1 r0 00 ie wcm write: reset: 11100000 = unimplemented figure 14-3. bdlc control register 1 (bcr1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc cpu interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required they may be written only once after reset and then they become read- only bits. the value programmed into these bits is dependent on the chosen mcu system clock frequency per table 14-1 and table 14-2 . ie interrupt enable this bit determines whether the bdlc will generate cpu interrupt requests in run mode. it does not affect cpu interrupt requests when exiting bdlc stop or wait modes. by performing the specified actions upon the bdlcs registers, interrupt requests will be maintained until all interrupt request sources are cleared. by performing the specified actions upon the bdlcs registers, interrupts pending at the time that this bit is cleared may be lost. 1 = enable interrupt requests from bdlc 0 = disable interrupt requests from bdlc if the programmer does not want to use the interrupt capability of the bdlc, the bdlc state vector register (bsvr) can be polled periodically by the programmer to determine bdlc states. refer to 14.6.3 bdlc state vector register for a description of bsvr register. table 14-1. bdlc rate selection for binary frequencies clock frequency r1 r0 division f bdlc f op =1.048576 mhz 0 0 1 1.048576 mhz f op = 2.09715 mhz 0 1 2 1.048576 mhz f op = 4.19430 mhz (see note) 1 0 4 1.048576 mhz f op = 8.38861 mhz (see note) 1 1 8 1.048576 mhz note: invalid option on this mcu table 14-2. bdlc rate selection for integer frequencies clock frequency r1 r0 division f bdlc f op = 1.00000 mhz 0 0 1 1.000000 mhz f op = 2.00000 mhz 5 1 2 1.000000 mhz f op = 4.00000 mhz (see note) 1 0 4 1.000000 mhz f op = 8.00000 mhz (see note) 1 1 8 1.000000 mhz note: invalid option on this mcu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) wcm wait clock mode this bit determines the operation of the bdlc during cpu wait mode. see 14.5.5 bdlc stop mode and 14.5.4 bdlc wait mode for more details on its use. 1 = stop bdlc internal clocks during cpu wait mode 0 = run bdlc internal clocks during cpu wait mode 14.6.2 bdlc control register 2 this register controls transmitter operations of the bdlc. albe analog loopback mode this bit is used to reset the bdlc state machine to a known state after the user has put the off-chip analog transceiver in loopback mode. when the user clears albe to indicate that the off-chip analog transceiver is no longer in loopback mode, the bdlc waits for an eof symbol before attempting to transmit. 1 = indicates to the bdlc that the off-chip analog transceiver is being put in analog loopback mode. 0 = when albe is cleared, the bdlc requires the bus to be idle for a minimum of end-of-frame symbol (t tv4 ) time before allowing a reception of a message. the bdlc requires the bus to be idle for a minimum of inter-frame separator symbol (t tv6 ) time before allowing any message to be transmitted. dlbe digital loopback mode this bit determines the source to which the digital receive input is connected to and can be used to isolate the bus fault condition. if a fault condition has been detected on the bus, this control bit allows the programmer to connect the digital transmit output to the digital receive input. in this configuration, data sent from the transmit buffer should $003b bit 7 654321 bit 0 read: albe dlbe rx4xe nbfs teod tsifr tmifr1 tmifr0 write: reset: 11000000 figure 14-4. bdlc control register 2 (bcr2) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc cpu interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required be reflected back into the receive buffer. if no faults exist in the digital block, the fault is in the physical interface block or elsewhere on the j1850 bus. 1 = when set, rxpd is connected to txpd. the bdlc is now in digital loopback mode of operation and the txpd signal is not observable on the txp pin. 0 = when cleared, rxpd is connected to the rxp input pin and the bdlc is taken out of digital loopback mode. now the bdlc can drive and receive from the j1850 bus normally after the bus is idle for at least a t tv4 time for receive and a t tv6 time for transmit. rx4xe receive 4x enable this bit determines if the bdlc operates at normal transmit and receive speed (10.4 kbps) or receive only at 41.6 kbps. this feature is useful for fast download of data into a j1850 node for diagnostic or factory programming. 1 = when set, the bdlc is put in 4x receive-only operation. 0 = when cleared, the bdlc transmits and receives at 10.4 kbps. reception of a break symbol automatically clears this bit and sets bsvr (see 14.7.3 rx and tx shadow registers ) register to $1c. nbfs normalization bit format select this bit controls the format of the normalization bit (nb). sae j1850 strongly encourages the use of an active long, 0, for in-frame responses containing crc and active short, 1, for in-frame responses without crc. 1 = nb that is received or transmitted is a 0 when the response part of an in-frame response (ifr) ends with a crc byte. nb that is received or transmitted is a 1 when the response part of an in-frame response (ifr) does not end with a crc byte. 0 = nb that is received or transmitted is a 1 when the response part of an in-frame response (ifr) ends with a crc byte. nb that is received or transmitted is a 0 when the response part of an in-frame response (ifr) does not end with a crc byte. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) teod transmit end of data the programmer sets this bit to indicate the end of a message being sent by the bdlc. it will append an 8-bit crc after completing transmission of the current byte. this bit also is used to end an ifr. if the transmit shadow register (refer to 14.7.3 rx and tx shadow registers for a description of the transmit shadow register) is full when teod is set, the crc byte will be transmitted after the current byte in the tx shift register and the byte in the tx shadow register have been transmitted. once teod is set, the transmit data register empty flag (tdre) in the bdlc state vector register (bsvr) is cleared to allow lower priority interrupts to occur. 1 = transmit eod symbol 0 = the teod bit will be cleared automatically at the rising edge of the first crc bit that is sent or whenever an error is detected. if teod is used to end an ifr transmission, it is cleared when the bdlc receives a valid eod symbol or an error condition occurs. tsifr, tmifr1, and tmifr0 transmit in-frame response control these three bits control the type of in-frame response being sent. the programmer should not set more than one of these control bits to 1 at any given time. however, if more than one of these three control bits are set to 1, the priority encoding logic will force the internal register bits to a known value as shown in table 14-3 . but, when these bits are read, they will be the same as written earlier. for instance, if 011 is written to tsifr, tmifr1, and tmifr0, then internally theyll be encoded as 010. however, when these bits are later read back, the value will still be 011. table 14-3. transmit in-frame response control bit priority encoding write (then read back) tsifr write (then read back) tmifr1 write (then read back) tmifr0 actual tsifr actual tmifr1 actual tmifr0 000000 1xx100 01x010 001001 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc cpu interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required the bdlc supports the in-frame response (ifr) feature of j1850. the three types of j1850 ifr are shown in figure 14-5 . figure 14-5. types of in-frame response tsifr transmit single byte ifr with no crc (type 1) this bit is used to request the bdlc to transmit the byte in the bdlc data register (bdr) as a single byte ifr with no crc. 1 = if this bit is set prior to a valid eod being received with no crc error, once the eod symbol has been received the bdlc will attempt to transmit the appropriate normalization bit followed by the byte in the bdr. 0 = the tsifr bit will be automatically cleared once the bdlc has successfully transmitted the byte in the bdr onto the bus, or teod is set by the cpu, or an error is detected on the bus. if a loss of arbitration occurs when the bdlc attempts to transmit the byte in the bdlc, once the ifr byte winning arbitration completes transmission, the bdlc will again attempt to transmit the byte in the bdr (with no normalization bit). the bdlc will continue transmission attempts until an error is detected on the bus, or teod is set by the cpu, or the bdlc transmission is successful. if loss of arbitration sof header data field crc eod type 0 no ifr header data field crc eod type 3 multiple bytes from a single responder header data field crc eod type 1 single byte from a single responder header data field crc eod type 2 single byte from multiple responders id1 id n ifr data field crc nb nb nb id sof sof sof eof eod eof eod eof eod eof nb = normalized bit id = identifier (usually the physical address of the responder(s)) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) occurs in the last two bits of the ifr byte, two additional 1 bits will not be sent out because the bdlc will attempt to retransmit the byte in the tx shift register after the ifr byte winning arbitration completes transmission. if the programmer attempts to set the tsifr bit immediately after the eod symbol has been received from the bus, the tsifr bit will remain in the reset state, and no attempt will be made to transmit the ifr byte. tmifr1 transmit multiple byte ifr with crc (type 3) this bit requests the bdlc to transmit the byte in the bdlc data register (bdr) as the first byte of a multiple byte ifr with crc or as a single byte ifr with crc. if this bit is set prior to a valid eod being received with no crc error and once the eod symbol has been received, the bdlc will attempt to transmit the appropriate normalization/format symbol, followed by the byte in the bdr. after the byte in the bdr has been loaded into the transmit shift register, a tdre interrupt will occur, similar to the main message transmit sequence. the programmer should then load the next byte of the ifr into the bdr for transmission. when the last byte of the ifr has been loaded into the bdr, the programmer should set the teod bit in the bcr register. this will instruct the bdlc to transmit a crc byte once the byte in the bdr is transmitted, and then transmit an eod symbol, indicating the end of the ifr portion of the message frame. the tmifr1 bit will be automatically cleared once the bdlc has successfully transmitted the crc byte and eod symbol, by the detection of an error on the multiplex bus or by a transmitter underrun caused when the programmer does not write another byte to the bdr after the tdre interrupt. if a loss of arbitration occurs when the bdlc is transmitting any multiple byte ifr, bdlc will go to the loss of arbitration state, set the appropriate flag, and cease transmission. if the bdlc loses arbitration during the ifr, the tmifr1 bit will be cleared and no attempt will be made to retransmit the byte in the bdr. if loss of arbitration occurs in the last two bits of the ifr byte, two additional 1 bits will be sent out. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc cpu interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required if the programmer wishes to transmit a single byte followed by a crc byte, the programmer should load the byte into the bdr before the eod symbol has been received and then set the tmifr1 bit. once the eod interrupt occurs, the programmer should then set the teod bit in the bcr. this will result in the byte in the bdr being the only byte transmitted before the ifr crc byte, and no tdre interrupt will be generated. if the programmer attempts to set the tmifr1 bit immediately after the eod symbol has been received from the bus, the tmifr1 bit will remain in the reset state, and no attempt will be made to transmit an ifr byte. 1 = if this bit is set prior to a valid eod being received with no crc error, once the eod symbol has been received the bdlc will attempt to transmit the appropriate normalization bit followed by ifr bytes. the programmer should set teod after the last ifr byte has been written into bdr register. after teod has been set and the last ifr byte has been transmitted, the crc byte is transmitted. 0 = the tmifr1 bit will be cleared automatically, once the bdlc has successfully transmitted the crc byte and eod symbol, by the detection of an error on the multiplex bus or by a transmitter underrun caused when the programmer does not write another byte to the bdr after the tdre interrupt. tmifr0 transmit multiple byte ifr without crc (type 2) this bit is used to request the bdlc to transmit the byte in the bdlc data register (bdr) as the first byte of a multiple byte ifr without crc. if this bit is set prior to a valid eod being received with no crc error, once the eod symbol has been received, the bdlc will attempt to transmit the appropriate normalization/format symbol, followed by the byte in the bdr. after the byte in the bdr has been loaded into the transmit shift register, a tdre interrupt will occur, similar to the main message transmit sequence. the programmer should then load the next byte of the ifr into the bdr for transmission. when the last byte of the ifr has been loaded into the bdr, the programmer should set f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) the teod bit in the bcr2 register. this will instruct the bdlc to transmit an eod symbol, indicating the end of the ifr portion of the message frame. the bdlc will not append a crc. the tmifr0 bit will be cleared automatically, once the bdlc has successfully transmitted the eod symbol, by the detection of an error on the multiplex bus or by a transmitter underrun caused when the programmer does not write another byte to the bdr following the tdre interrupt. if a loss of arbitration occurs when the bdlc is transmitting, the tmifr0 bit will be cleared, and no attempt will be made to retransmit the byte in the bdr. if loss of arbitration occurs in the last two bits of the ifr byte, two additional one bits (active short bits) will be sent out. if the programmer attempts to set the tmifr0 bit after the eod symbol has been received from the bus, the tmifr0 bit will remain in the reset state and no attempt will be made to transmit an ifr byte. 1 = if this bit is set prior to a valid eod being received with no crc error, once the eod symbol has been received the bdlc will attempt to transmit the appropriate normalization bit followed by ifr bytes. the programmer should set teod after the last ifr byte has been written into bdr register. after teod has been set, the last ifr byte to be transmitted will be the last byte which was written into the bdr register. 0 = the tmifr0 bit will be cleared automatically once the bdlc has successfully transmitted the eod symbol, by the detection of an error on the multiplex bus or by a transmitter underrun caused when the programmer does not write another byte to the bdr after the tdre interrupt. 14.6.3 bdlc state vector register this register is provided to substantially decrease the cpu overhead associated with servicing interrupts while under operation of a mux protocol. it provides an index offset that is directly related to the bdlcs current state, which can be used with a user supplied jump table to rapidly enter an interrupt service routine. this eliminates the need for the user to maintain a duplicate state machine in software. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc cpu interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required i0, i1, i2, i3 interrupt source these bits indicate the source of the interrupt request that is currently pending. the encoding of these bits is found in table 14-4 . bits i0, i1, i2, and i3 are cleared by a read of the bsvr register except when the bdlc data register needs servicing (rdrf, rxifr, or tdre conditions). rxifr and rdrf can be cleared only by a read of the bsvr register followed by a read of bdr. tdre can either be cleared by a read of the bsvr register followed by a write to the bdlc bdr register or by setting the teod bit in bcr2. a read of the bsvr in either a symbol invalid or loss of arbitration condition will result in removal of a pending tx data register empty condition. $003c bit 7 654321 bit 0 read: 0 0 i3 i2 i1 i0 0 0 write: reset: 00000000 = unimplemented figure 14-6. bdlc state vector register (bsvr) table 14-4. interrupt sources bsvr i3 i2 i1 i0 interrupt source priority $00 0000 no interrupts pending 0 (lowest) $04 0001 received eof 1 $08 0010 received ifr byte (rxifr) 2 $0c 0011 rx data register full (rdrf) 3 $10 0100 tx data register empty (tdre) 4 $14 0101 loss of arbitration 5 $18 0110 crc error 6 $1c 0111 symbol invalid or out of range 7 $20 1000 wakeup 8 (highest) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) upon receiving a bdlc interrupt, the user may read the value within the bsvr, transferring it to the cpus index register. the value may then be used to index into a jump table with entries four bytes apart to quickly enter the appropriate service routine. for example: service ldx bsvr fetch state vector number jmp jmptab,xenter service routine, * (must end in an rti) * jmptab jmp serve0service condition #0 nop jmp serve1service condition #1 nop jmp serve2service condition #2 nop .. .. jmp serve8service condition #8 end note: the nops are just used to align the jmps onto 4-byte boundaries so that the value in the bsvr may be used intact. each of the service routines must end with an rti instruction to guarantee correct continued operation of the device. note also that the first entry can be omitted since it corresponds to no interrupt occurring. the service routines should clear all of the sources that are causing the pending interrupts. note that the clearing of a high priority interrupt may still leave a lower priority interrupt pending, in which case bits i0, i1, and i2 of the bsvr will then reflect the source of the remaining interrupt request. if fewer states are used or if a different software approach is taken, the jump table may be made smaller or omitted altogether. 14.6.4 bdlc data register this register is used to pass the data to be transmitted to the j1850 bus from the cpu to the bdlc. it is also used to pass data received from the j1850 bus to the cpu. each data byte (after the first one) should be written only after a tx data register empty (tdre) interrupt has occurred or the bsvr register has been polled indicating this condition. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc cpu interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required data read from this register will be the last data byte received from the j1850 bus. this received data should only be read after a rx data register full (rdrf) interrupt has occurred. the bdr register is double buffered via a transmit shadow register and a receive shadow register. after the byte in the transmit shift register has been transmitted, the byte currently stored in the transmit shadow register is loaded into the transmit shift register. once the transmit shift register has shifted the first bit out, the tdre flag is set, and the shadow register is ready to accept the next byte of data. the receive shadow register works similarly. once a complete byte has been received, the receive shift register stores the newly received byte into the receive shadow register. the rdrf flag is set to indicate that a new byte of data has been received. the programmer has one bdlc byte reception time to read the shadow register and clear the rdrf flag before the shadow register is overwritten by the newly received byte. to abort an in-progress transmission, the programmer should simply stop loading more data into the bdr. this will cause a transmitter underrun error and the bdlc automatically will disable the transmitter on the next non-byte boundary. this means that the earliest a transmission can be halted is after at least one byte (plus two extra 1 bits) has been transmitted. the receiver will pick this up as an error and relay it in the state vector register as an invalid symbol error. 14.6.5 bdlc analog and roundtrip delay this register is used to program the bdlc so that it compensates for various delays of different external transceivers. the default delay value is 16 m s. the bard offset bits range from 0 through 15. table 14-1 illustrates the corresponding expected delays on the external $003d bit 7 654321 bit 0 read: d7 d6 d5 d4 d3 d2 d1 d0 write: reset: indeterminate after reset figure 14-7. bdlc data register (bdr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) transceivers to be connected to the bdlc. this allows flexibility of timing adjustments from 9 m s to 24 ms in 1 m s steps. this register can be written to only once after a reset. subsequent writes to the register will have no effect. read: any time write: once after reset ate analog transceiver enable the analog transceiver enable (ate) bit is used to select either the on-board or an off-chip analog transceiver. 1 = select on-board analog transceiver 0 = select off-chip analog transceiver note: this device does not contain an on-board transceiver. this bit should be programmed to a logic 0 for proper operation. rxpol rxp polarity select 1 = receiver polarity is j1850 protocol without an inversion 0 = receiver polarity is inverted j1850 protocol $003e bit 7 654321 bit 0 read: ate rxpol 0 0 bo3 bo2 bo1 bo0 write: reset: 11000111 figure 14-8. bdlc analog roundtrip delay register (bard) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc cpu interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required bo3 - bo0 bard offset bits table 14-5 shows the expected transceiver delay with respect to bard offset values: table 14-5. bard offset delays bard offset bits (bo3, bo2, bo1, bo0) corresponding expected transceivers delays ( m s) 0000 9 0001 10 0010 11 0011 12 0100 13 0101 14 0110 15 0111 16 1000 17 1001 18 1010 19 1011 20 1100 21 1101 22 1110 23 1111 24 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) 14.7 bdlc protocol handler the protocol handler is responsible for framing, collision detection, arbitration, crc generation/checking, and error detection. the protocol handler conforms to sae j1850 - class b data communications network interface. 14.7.1 protocol architecture the protocol handler contains the state machine, rx shadow register, tx shadow register, rx shift register, tx shift register, and loopback multiplexer as shown in figure 14-9 . each block is described in more detail. figure 14-9. bdlc protocol handler outline rx shift register to cpu interface and rx/tx buffers state machine rx data tx data control 8 tx shift register txpd rxpd control 8 rx shadow register tx shadow register loopback rxp loopback control txp multiplexer dlbe from bcr2 albe f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc protocol handler mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required 14.7.2 rx and tx shift registers the rx shift register gathers received serial data bits from the j1850 bus and makes them available in parallel form to the rx shadow register. the tx shift register takes data, in parallel form, from the tx shadow register and presents it serially to the state machine so that it can be transmitted onto the j1850 bus. 14.7.3 rx and tx shadow registers immediately after the rx shift register has completed shifting in a byte of data, this data is transferred to the rx shadow register and rdrf or rxifr is set and interrupt is generated if the interrupt enable bit (ie) in bcr1 is set. after the transfer takes place, this new data byte in the rx shadow register is available to the cpu interface, and the rx shift register is ready to shift in the next byte of data. data in rx shadow register must be retrieved by the cpu before it is overwritten by new data from the rx shift register. once the tx shift register has completed its shifting operation for the current byte, the data byte in the tx shadow register is loaded into the tx shift register. after this transfer takes place, the tx shadow register is ready to accept new data from the cpu. 14.7.4 digital loopback multiplexer the digital loopback multiplexer connects rxp to txp internally, when the dlbe bit in bcr2 register is set. 14.7.5 state machine all functions associated with performing the protocol are executed or controlled by the state machine. the state machine is responsible for framing, collision detection, arbitration, crc generation/checking, and error detection. the following sections describe the bdlcs actions in a variety of situations. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) 14.7.5.1 4x mode the bdlc can exist on the same j1850 bus as modules which use a special 4x (41.6 kbps) mode of j1850 vpw operation. the bdlc cannot transmit in 4x mode, but can receive messages in 4x mode, if the rx4x bit is set in the bcr2 register. if the rx4x bit is not set in the bcr2 register, any 4x message on the j1850 bus is treated as noise by the bdlc and is ignored. 14.7.5.2 receiving a message in block mode although not a part of the sae j1850 protocol, the bdlc does allow for a special block mode of operation of the receiver. as far as the bdlc is concerned, a block mode message is simply a long j1850 frame that contains an indefinite number of data bytes. all of the other features of the frame remain the same, including the sof, crc, and eod symbols. another node wishing to send a block mode transmission must first inform all other nodes on the network that this is about to happen. this is usually accomplished by sending a special predefined message. 14.7.5.3 transmitting a message in block mode a block mode message is transmitted inherently by simply loading the bytes one by one into the bdr register until the message is complete. the programmer should wait until the tdre flag is set prior to writing a new byte of data into the bdr register. the bdlc does not contain any predefined maximum j1850 message length requirement. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc protocol handler mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required 14.7.6 j1850 bus errors the bdlc detects several types of transmit and receive errors which can occur during the transmission of a message onto the j1850 bus. if the bdlc is transmitting a message and the message received contains invalid bits or framing symbols on non-byte boundaries, this constitutes a transmission error. when a transmission error is detected, the bdlc will immediately cease transmitting. the error condition is reflected in the bsvr register. if the interrupt enable bit (ie) is set, an interrupt request from the bdlc is generated. 14.7.6.1 crc error a crc error is detected when the data bytes and crc byte of a received message are processed, and the crc calculation result is not equal to $c4. the crc code should detect any single-bit and 2- bit errors, as well as all 8-bit burst errors and almost all other types of errors. crc error flag is set when a crc error is detected. 14.7.6.2 symbol error a symbol error is detected when an abnormal (invalid) symbol is detected in a message being received from the j1850 bus. however, if the bdlc is transmitting when this happens, it will be treated as a loss of arbitration rather than a transmitter error. symbol invalid or out-of- range flag is set when a symbol error is detected. 14.7.6.3 framing error a framing error is detected if an eod or eof symbol is detected on a non-byte boundary from the j1850 bus. symbol invalid or out-of-range flag is set when a framing error is detected. 14.7.6.4 bus fault if a bus fault occurs, the response of the bdlc will depend upon the type of bus fault. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) if the bus is shorted to v batt , the bdlc will wait for the bus to fall to a passive state before it will attempt to transmit a message. as long as the short remains, the bdlc will never attempt to transmit a message onto the j1850 bus. if the bus is shorted to ground, the bdlc will see an idle bus, begin to transmit the message, and then detect a transmission error, since the short to ground would not allow the bus to be driven to the active (dominant) state. the bdlc will abort that transmission and wait for the next cpu command to transmit. in any case, if the bus fault is temporary, as soon as the fault is cleared, the bdlc will resume normal operation. if the bus fault is permanent, it may result in permanent loss of communication on the j1850 bus. 14.7.6.5 break (break) if a break symbol is received while the bdlc is transmitting or receiving, an invalid symbol interrupt will be generated. reading the bsvr register will clear this interrupt condition. the bdlc will wait for bus to idle, then wait for sof. the bdlc cannot transmit a break symbol. it can receive only a break symbol from the j1850 bus. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc mux interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required 14.8 bdlc mux interface the mux interface is responsible for bit encoding/decoding and digital noise filtering between the protocol handler and the physical interface. 14.8.1 rx digital filter the receiver section of the bdlc includes a digital low pass filter to remove narrow noise pulses from the incoming message. an outline of the digital filter is shown in figure 14-10 . table 14-6. bdlc j1850 bus error summary error condition bdlc function bus short to battery the bdlc will not transmit until the bus is idle. bus short to gnd fault condition is re?ected in bsvr as invalid symbol. invalid symbol: bdlc receives invalid bits (noise). the bdlc will abort transmission immediately. invalid symbol interrupt will be generated. framing error invalid symbol interrupt will be generated. the bdlc will wait for sof. crc error crc error interrupt will be generated. the bdlc will wait for sof. bdlc receives break symbol the bdlc will wait for the next valid sof. invalid symbol interrupt will be generated. invalid symbol: bdlc sends an eod but receives an active symbol. invalid symbol interrupt will be generated. the bdlc will wait for sof. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) figure 14-10. bdlc rx digital filter block diagram 14.8.1.1 operation the clock for the digital filter is provided by the mux interface clock. at each positive edge of the clock signal, the current state of the receiver physical interface (rxp) signal is sampled. the rxp signal state is used to determine whether the counter should increment or decrement at the next negative edge of the clock signal. the counter will increment if the input data sample is high but decrement if the input sample is low. the counter will thus progress up toward 15 if, on average, the rxp signal remains high or progress down towards 0 if, on average, the rxp signal remains low. when the counter eventually reaches the value 15, the digital filter decides that the condition of the rxp signal is at a stable logic level one and the data latch is set, causing the filtered rx data signal to become a logic level 1. furthermore, the counter is prevented from overflowing and can only be decremented from this state. alternatively, should the counter eventually reach the value 0, the digital filter decides that the condition of the rxp signal is at a stable logic level zero and the data latch is reset, causing the filtered rx data signal to become a logic level 0. furthermore, the counter is prevented from underflowing and can only be incremented from this state. the data latch will retain its value until the counter next reaches the opposite end point, signifying a definite transition of the rxp signal. 4-bit up/down counter up/ down out dq filtered rx data out mux interface clock input sync dq rx data from physical interface (rxp) 4 edge and count comparator f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc mux interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required 14.8.1.2 performance the performance of the digital filter is best described in the time domain rather than the frequency domain. if the signal on the rxp signal transitions, then there will be a delay before that transition appears at the filtered rx data output signal. this delay will be between 15 and 16 clock periods, depending on where the transition occurs with respect to the sampling points. this filter delay must be taken into account when performing message arbitration. for example, if the frequency of the mux interface clock (f bdlc ) is 1.0486 mhz, then the period (t bdlc ) is 954ns and the maximum filter delay in the absence of noise will be 15.259 m s. the effect of random noise on the rxp signal depends on the characteristics of the noise itself. narrow noise pulses on the rxp signal will be completely ignored if they are shorter than the filter delay. this provides a degree of low pass filtering. if noise occurs during a symbol transition, the detection of that transition may be delayed by an amount equal to the length of the noise burst. this is just a reflection of the uncertainty of where the transition is truly occurring within the noise. noise pulses that are wider than the filter delay, but narrower than the shortest allowable symbol length will be detected by the next stage of the bdlcs receiver as an invalid symbol. noise pulses that are longer than the shortest allowable symbol length will normally be detected as an invalid symbol or as invalid data when the frames crc is checked. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) 14.8.2 j1850 frame format all messages transmitted on the j1850 bus are structured using this format: figure 14-11. j1850 bus message format (vpw) sae j1850 states that each message has a maximum length of 101 bit times or 12 bytes (excluding sof, eod, nb, and eof). sof start of frame symbol all messages transmitted onto the j1850 bus must begin with an sof symbol. this indicates the start of a new message transmission to any listeners on the j1850 bus. the sof symbol is not used in the crc calculation. data in message data bytes the data bytes contained in the message include the message priority/type, message id byte, and any actual data being transmitted to the receiving node. the message format used by the bdlc is similar to the 3-byte consolidated header message format outlined by the sae j1850 document. see sae j1850 - class b data communications network interface, for more information about 1- and 3-byte headers. messages transmitted by the bdlc onto the j1850 bus must contain at least one data byte, and, therefore, can be as short as one data byte and one crc byte. each data byte in the message is eight bits in length and is transmitted msb to lsb. sof e o d eof priority message data n crc ifr i f s idle idle id (data1) (data0) optional f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc mux interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required crc cyclical redundancy check byte this byte is used by the receiver(s) of each message to determine if any errors have occurred during the transmission of the message. the bdlc calculates the crc byte and appends it onto any messages transmitted onto the j1850 bus, and also performs crc detection on any messages it receives from the j1850 bus. crc generation uses the divisor polynomial x 8 + x 4 + x 3 + x 2 + 1. the remainder polynomial is initially set to all ones, and then each byte in the message after the sof symbol is serially processed through the crc generation circuitry. the ones complement of the remainder then becomes the 8-bit crc byte, which is appended to the message after the data bytes, in msb to lsb order. when receiving a message, the bdlc uses the same divisor polynomial. all data bytes, excluding the sof and eod symbols, but including the crc byte, are used to check the crc. if the message is error free, the remainder polynomial will equal x 7 + x 6 + x 2 ($c4), regardless of the data contained in the message. if the calculated crc does not equal $c4, the bdlc will recognize this as a crc error and set the crc error flag in the bsvr register. eod end of data symbol the eod symbol is a short passive period on the j1850 bus used to signify to any recipients of a message that the transmission by the originator has completed. no flag is set upon reception of eod symbol. ifr in-frame response bytes the ifr section of the j1850 message format is optional. users desiring further definition of in-frame response should review the sae j1850 class b data communications network interface specification eof end of frame symbol this symbol is a passive period on the j1850 bus, longer than an eod symbol, which signifies the end of a message. since an eof symbol is longer than an eod symbol, if no response is transmitted f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) after an eod symbol, it becomes an eof, and the message is assumed to be completed. eof flag is set upon receiving the eof symbol. ifs inter-frame separation symbol the ifs symbol is a passive period on the j1850 bus which allows proper synchronization between nodes during continuous message transmission. the ifs symbol is transmitted by a node following the completion of the eof period. when the last byte of a message has been transmitted onto the j1850 bus, and the eof symbol time has expired, all nodes must then wait for the ifs symbol time to expire before transmitting an sof, marking the beginning of another message. however, if the bdlc is waiting for the ifs period to expire before beginning a transmission and a rising edge is detected before the ifs time has expired, it will internally synchronize to that edge. if a write to the bdr register (initiate transmission) occurred on or before 104 x t bdlc from the received rising edge, then the bdlc will transmit and arbitrate for the bus. if a cpu write to the bdr register occurred after 104 x t bdlc from the detection of the rising edge, then the bdlc will not transmit, but will wait for the next ifs period to expire before attempting to transmit the byte. a rising edge may occur during the ifs period because of varying clock tolerances and loading of the j1850 bus, causing different nodes to observe the completion of the ifs period at different times. receivers must synchronize to any sof occurring during an ifs period to allow for individual clock tolerances. break break if the bdlc is transmitting at the time a break is detected, it treats the break as if a transmission error had occurred, and halts transmission. the bdlc cannot transmit a break symbol. if while receiving a message the bdlc detects a break symbol, it treats the break as a reception error and sets the invalid symbol flag. if while receiving a message in 4x mode, the bdlc detects a break f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc mux interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required symbol, it treats the break as a reception error, sets bsvr register to $1c, and exits 4x mode. the rx4xe bit in bcr2 is cleared automatically upon reception of the break symbol. idle bus an idle condition exists on the bus during any passive period after expiration of the ifs period. any node sensing an idle bus condition can begin transmission immediately. 14.8.3 j1850 vpw symbols huntsingers variable pulse width modulation (vpw) is an encoding technique in which each bit is defined by the time between successive transitions and by the level of the bus between transitions, active or passive. active and passive bits are used alternately. each logic 1 or logic 0 contains a single transition, and can be at either the active or passive level and one of two lengths, either 64 m s or 128 m s (t nom at 10.4 kbps baud rate), depending upon the encoding of the previous bit. the sof, eod, eof and ifs symbols will always be encoded at an assigned level and length. see figure 14-12 . each message will begin with an sof symbol, an active symbol, and therefore each data byte (including the crc byte) will begin with a passive bit, regardless of whether it is a logic 1 or a logic 0. all vpw bit lengths stated in the following descriptions are typical values at a 10.4 kbps bit rate. 14.8.3.1 logic 0 a logic 0 is defined as either an active-to-passive transition followed by a passive period 64 m s in length or a passive-to-active transition followed by an active period 128 m s in length ( figure 14-12 (a)). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) 14.8.3.2 logic 1 a logic 1 is defined as either an active-to-passive transition followed by a passive period 128 m s in length or a passive-to-active transition followed by an active period 64 m s in length ( figure 14-12 (b)). figure 14-12. j1850 vpw symbols 128 m s active passive 64 m s or logic 0 128 m s active passive 64 m s or logic 1 200 m s active passive start of frame 200 m s end of data 280 m s active passive end of frame 3 240 m s break (a) (b) (c) (d) (e) (f) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc mux interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required 14.8.3.3 normalization bit (nb) the nb symbol has the same property as a logic 1 or a logic 0. 14.8.3.4 start of frame symbol (sof) the sof symbol is defined as passive-to-active transition followed by an active period 200 m s in length ( figure 14-12 (c)). this allows the data bytes which follow the sof symbol to begin with a passive bit, regardless of whether it is a logic 1 or a logic 0. 14.8.4 eod - end of data symbol the eod symbol is defined as an active-to-passive transition followed by a passive period 200 m s in length ( figure 14-12 (d)). 14.8.4.1 end of frame symbol (eof) the eof symbol is defined as an active-to-passive transition followed by a passive period 280 m s in length ( figure 14-12 (e)). if there is no ifr byte transmitted after an eod symbol is transmitted, after another 80 m s the eod becomes an eof, indicating the completion of the message. 14.8.4.2 inter-frame separation symbol (ifs) the ifs symbol is defined as a passive period 300 m s in length. the ifs symbol contains no transition, since it always follows an eof symbol when it is used. 14.8.4.3 break signal (break) the break signal is defined as a passive-to-active transition followed by an active period of at least 240 m s ( figure 14-12 (f)). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) 14.8.5 j1850 vpw valid/invalid bits and symbols the timing tolerances for receiving data bits and symbols from the j1850 bus have been defined to allow for variations in oscillator frequencies. in many cases, the maximum time allowed to define a data bit or symbol is equal to the minimum time allowed to define another data bit or symbol. since the minimum resolution of the bdlc for determining what symbol is being received is equal to a single period of the mux interface clock (t bdlc ), an apparent separation in these maximum time/minimum time concurrences equal to one cycle of t bdlc occurs. this one clock resolution allows the bdlc to differentiate properly between the different bits and symbols, without reducing the valid window for receiving bits and symbols from transmitters onto the j1850 bus having varying oscillator frequencies. in vpw bit encoding, the tolerances for the both passive and active data bits and symbols are defined with no gaps between definitions. for example, the maximum length of a passive logic 0 is equal to the minimum length of a passive logic 1, and the maximum length of an active logic 0 is equal to the minimum length of a valid sof symbol. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc mux interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required figure 14-13. j1850 vpw passive symbols 14.8.5.1 invalid passive bit if the passive-to-active transition beginning the next data bit or symbol occurs between the active-to-passive transition beginning the current data bit or symbol and t trvp1(min) , the current bit would be invalid. see figure 14-13 (1). 14.8.5.2 valid passive logic 0 if the passive-to-active transition beginning the next data bit or symbol occurs between t trvp1(min) and t trvp1(max) , the current bit would be considered a logic 0. see figure 14-13 (2). t trvp1(min) t trvp1(max) t rvp2(max) t trvp1(max) t trvp1(min) (1) invalid passive bit (2) valid passive logic 0 (3) valid passive logic 1 64 m s 128 m s t rvp2(max) t trvp3(max) (4) valid eod symbol 200 m s active passive active passive active passive active passive f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) 14.8.5.3 valid passive logic 1 if the passive-to-active transition beginning the next data bit or symbol occurs between t trvp1(max) and t trvp2(max) , the current bit would be considered a logic 1. see figure 14-13 (3). 14.8.5.4 valid eod symbol if the passive-to-active transition beginning the next data bit or symbol occurs between t trvp2(max) and t trvp3(max) , the current symbol would be considered a valid eod symbol. see figure 14-13 (4). figure 14-14. j1850 vpw eof and ifs symbols t tv6(min) (2) valid eof+ ifs symbol 280 m s 300 m s t trv4(min) t trv4(max) (1) valid eof symbol active passive active passive f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc mux interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required 14.8.5.5 valid eof and ifs symbol in figure 14-14 (1), if the passive-to-active transition beginning the sof symbol of the next message occurs between t trv4(min) and t trv4(max) , the current symbol will be considered a valid eof symbol. if the passive-to- active transition beginning the sof symbol of the next message occurs after t tv6(min) , the current symbol will be considered a valid eof symbol followed by a valid ifs symbol. see figure 14-14 (2). all nodes must wait until a valid ifs symbol time has expired before beginning transmission. however, due to variations in clock frequencies and bus loading, some nodes may recognize a valid ifs symbol before others and immediately begin transmitting. therefore, any time a node waiting to transmit detects a passive-to-active transition once a valid eof has been detected, it should begin transmission immediately, initiating the arbitration process. 14.8.5.6 idle bus if the passive-to-active transition beginning the sof symbol of the next message does not occur before d, the bus is considered to be idle, and any node wishing to transmit a message may do so immediately. figure 14-15. j1850 vpw active symbols t trva2(min) t tva2(max) t trva1(max) t trva2(max) t trva2(min) (1) invalid active bit (2) valid active logic 1 (3) valid active logic 0 64 m s 128 m s t trva1(max) t tva3(max) (4) valid sof symbol 200 m s active passive active passive active passive active passive f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) 14.8.5.7 invalid active bit if the active-to-passive transition beginning the next data bit or symbol occurs between the passive-to-active transition beginning the current data bit or symbol and t trva2(min) , the current bit would be invalid. see figure 14-15 (1). 14.8.5.8 valid active logic 1 if the active-to-passive transition beginning the next data bit or symbol occurs between t trva2(min) and t trva2(max) , the current bit would be considered a logic 1. see figure 14-15 (2). 14.8.5.9 valid active logic 0 if the active-to-passive transition beginning the next data bit or symbol occurs between t trva2(max) and t tva1(max) , the current bit would be considered a logic 0. see figure 14-15 (3). 14.8.5.10 valid sof symbol if the active-to-passive transition beginning the next data bit or symbol occurs between t trva1(max) and t tva3(max) , the current symbol would be considered a valid sof symbol. see figure 14-15 (4). figure 14-16. j1850 vpw break symbol (2) valid break 240 m s t trv6(min) symbol active passive f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc mux interface mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required 14.8.5.11 valid break symbol if the next active-to-passive transition does not occur until after t trv6(min) , the current symbol will be considered a valid break symbol. a break symbol should be followed by a sof symbol beginning the next message to be transmitted onto the j1850 bus. see figure 14-16 . 14.8.6 message arbitration message arbitration on the j1850 bus is accomplished in a non- destructive manner, allowing the message with the highest priority to be transmitted, while any transmitters which lose arbitration simply stop transmitting and wait for an idle bus to begin transmitting again. if the bdlc wants to transmit onto the j1850 bus, but detects that another message is in progress, it automatically waits until the bus is idle. however, if multiple nodes begin to transmit in the same synchronization window, message arbitration will occur beginning with the first bit after the sof symbol and continue with each bit thereafter. the vpw symbols and j1850 bus electrical characteristics are chosen carefully so that a logic 0 (active or passive type) will always dominate over a logic 1 (active or passive type) simultaneously transmitted. hence logic 0s are said to be dominant and logic 1s are said to be recessive. whenever a node detects a dominant bit when it transmitted a recessive bit, it loses arbitration and immediately stops transmitting. this is known as bitwise arbitration. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) figure 14-17. j1850 vpw bitwise arbitrations during arbitration, or even throughout the transmitting message, when an opposite bit is detected, transmission is immediately stopped unless it occurs on the eighth bit of a byte. in this case, the bdlc automatically will append two extra 1 bits and then stop transmitting. these two extra bits will be arbitrated normally and thus will not interfere with another message. the second 1 bit will not be sent if the first loses arbitration. if the bdlc has lost arbitration to another valid message, then the two extra ones will not corrupt the current message. however, if the bdlc has lost arbitration due to noise on the bus, then the two extra ones will ensure that the current message will be detected and ignored as a noise- corrupted message. since a 0 dominates a 1, the message with the lowest value will have the highest priority and will always win arbitration, for instance, a message with priority 000 will win arbitration over a message with priority 011. this method of arbitration will work no matter how many bits of priority encoding are contained in the message. transmitter a transmitter b j1850 bus sof data bit 1 data bit 4 data bit 5 0 transmitter a detects an active state on the bus and stops transmitter b wins passive active passive active passive active 0 0 1 1 1 data bit 2 1 1 1 data bit 3 0 0 0 0 1 arbitration and continues transmitting. transmitting. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
byte data link controller-digital (bdlc-d) bdlc application notes mc68HC05V12 rev. 1.0 general release specification byte data link controller-digital (bdlc-d) non-disclosure agreement required 14.9 bdlc application notes 14.9.1 initialization the mcu will first write to the bdlc control register (bcr1). this byte should configure the rate select bits to configure the mux interface clock to its nominal value, clear the imsg bit to enable normal bdlc operations, and set the interrupt enable bit if desired. 14.9.2 bdlc stop mode this power-conserving mode is entered automatically from the run mode whenever the cpu executes a stop instruction or if the cpu executes a wait instruction and the wcm bit in the bcr register is previously set. this is the lowest power mode that the bdlc can enter. a subsequent passive-to-active transition on the j1850 bus will cause the bdlc to wake up and generate a non-maskable cpu interrupt request. when a stop instruction is used to put the bdlc in stop mode, the bdlc will not correctly receive the byte that woke it up. this is due to a required oscillator stabilization delay for the bdlc internal operating clocks to restart. if a wait instruction is used to put the bdlc in stop mode, the bdlc is guaranteed to receive correctly the byte which woke it up, if and only if an eof has been detected prior to issuing the wait instruction by the cpu. otherwise the bdlc wil not correctly receive the byte that woke it up. if this mode is entered while the bdlc is receiving a message, the first subsequent received edge will cause the bdlc to wake up immediately, generate a cpu interrupt request, and wait for the bdlc internal operating clocks to restart and stabilize before normal communications can resume. therefore, the bdlc is not guaranteed to receive that message correctly. note: it is important to ensure that all transmissions are complete or aborted prior to putting the bdlc into stop mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required byte data link controller-digital general release specification mc68HC05V12 rev. 1.0 byte data link controller-digital (bdlc-d) 14.9.3 bdlc wait mode this power-conserving mode is entered automatically from run mode whenever the cpu executes a wait instruction and the wcm bit in the bcr register is previously clear. a subsequent successfully received message, including one that is in progress at the time that this mode is entered, will cause the bdlc to wake up and generate a cpu interrupt request if the interrupt enable (ie) bit in the bcr register is previously set. this results in saving less power, but the bdlc is guaranteed to correctly receive the message which woke it up, since the bdlc internal operating clocks are kept running. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required general release specification mc68HC05V12 section 15. gauge drivers 15.1 contents 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174 15.3 gauge system overview . . . . . . . . . . . . . . . . . . . . . . . . . . . .174 15.4 coil drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .176 15.5 technical note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .178 15.6 gauge driver control registers . . . . . . . . . . . . . . . . . . . . . . .179 15.6.1 gauge enable register . . . . . . . . . . . . . . . . . . . . . . . . . . .179 15.6.2 current magnitude registers . . . . . . . . . . . . . . . . . . . . . .181 15.6.3 current direction registers . . . . . . . . . . . . . . . . . . . . . . . .183 15.6.3.1 current direction register for major a . . . . . . . . . . . . . .183 15.6.3.2 current direction register for major b . . . . . . . . . . . . . .184 15.6.3.3 current direction register for minor a . . . . . . . . . . . . . .184 15.6.3.4 current direction register for minor b . . . . . . . . . . . . . .185 15.6.3.5 current direction register for minor c. . . . . . . . . . . . . .185 15.6.3.6 current direction register for minor d. . . . . . . . . . . . . .186 15.7 coil sequencer and control . . . . . . . . . . . . . . . . . . . . . . . . . .186 15.7.1 scanning sequence description . . . . . . . . . . . . . . . . . . . .186 15.7.1.1 automatic mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187 15.7.1.2 manual mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187 15.7.2 scan status and control register . . . . . . . . . . . . . . . . . . .189 15.8 mechanism diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .192 15.9 gauge power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .192 15.10 gauge regulator accuracy. . . . . . . . . . . . . . . . . . . . . . . . . . .194 15.11 coil current accuracy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .194 15.12 external component considerations . . . . . . . . . . . . . . . . . . .195 15.12.1 minimum voltage operation . . . . . . . . . . . . . . . . . . . . . . .196 15.12.2 power dissipation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .197 15.12.3 coil inductance limits . . . . . . . . . . . . . . . . . . . . . . . . . . . .198 15.13 operation in wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . .198 15.14 operation in stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . .199 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers 15.2 introduction the mc68HC05V12 contains on-chip circuitry to drive six cross coil air core gauges. four of the gauge drivers are 3-pin drivers intended for 180 gauges (minor gauges) and two of the drivers are full 4-pin h- bridge drivers for 360 gauges (major gauges). the output drivers for both major and minor gauges operate in a current drive mode. that is, the current in the gauge coils is controlled rather than the voltage across the coil. the maximum amount of current that can be driven into any coil is set by the value of the resistance between the i max and v ssa pins. the current driven into each coil is set by writing a hex value to the current magnitude registers and the direction of current is selected by setting or clearing the appropriate bits in the current direction registers. the ratio of the current used to set the gauge deflection angle is software configured. no particular drive technique is implemented in hardware. 15.3 gauge system overview the circuitry contained within the mc68HC05V12 provides a great deal of flexibility for driving the coils. the user specifies coil currents rather than degrees of deflection. this allows the software to drive the coil currents in a variety of ways. the user must specify the magnitude of the current as well as the direction it should flow for full h-bridge drivers. half h-bridge drivers require specification of a magnitude only. eight full h- bridge drivers and four half h-bridge drivers support two 360 and four 180 gauges. figure 15-1 is a block diagram of the gauge driver module within the mc68HC05V12. each of the blocks requiring more description is described in the following subsections. there are 20 coil driver pins on the mc68HC05V12. these are grouped into two types. the pins whose names start with maj are full h-bridge coil drivers. a or b in the pin name indicates major gauge a or b. a 1 or 2 in the name refers to coil 1 or coil 2 within the same gauge. it is important to keep coils within the same gauge connected to the same a or b coil driver pins. the + or - in the pin name indicates the direction of current flow according to this convention: the current direction positive f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
gauge drivers gauge system overview mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required current means current flow is out of the pin with the + in its name and into the pin with - in its name. negative current means current is flowing into the pin with the + in its name and out of the pin with - in its name. figure 15-1. gauge driver block diagram cpu bus 8-bit d/a 12 current magnitue and 6 current direction registers maja2+ maja2 - maja1+ maja1 - major drive a s&h coil 1 12-to-1 8-bitmux 8 * 12 8 majb2+ majb2 - majb1+ majb1 - major drive b mina2+ mina2 - mina1 minor drive a mind2+ mind2 - mind1 coil sequencer and control register sample and hold mux and current sense mux coil drivers mux control i to v converter i max r max 1% vref minor drive d d/a amp + _ s&h coil 2 s&h coil 1 s&h coil 2 s&h coil 1 s&h coil 2 s&h coil 1 s&h coil 2 12 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers 15.4 coil drivers to support both 180 and 360 gauges and to keep the pin count as low as possible, it is necessary to use two different types of coil drivers. these are the full h-bridge drivers and the half h-bridge drivers. major gauges will require two of the full h-bridge drivers and the minor gauges will require one full h-bridge driver and one half h-bridge driver. a full h- bridge driver uses two pins and is capable of driving a controlled current in either direction in a single coil. a half h-bridge driver uses only one pin and can sink a controlled amount of current in one direction only. the amount of current flowing through the coils and its direction in the case of the full h-bridge driver are controlled through the current magnitude registers (cmr) and the current direction registers (cdr) described here. all of the components shown in figure 15-2 and figure 15-3 are internal components except for the gauge coils. the resistive and inductive properties of the external coils are expected to fall within the ranges of r coil and l coil shown in section 17. electrical specifications . the resistance is important for calculating minimum operating voltages and power dissipation (see 15.12 external component considerations ), and the inductance is important in determining settling time (a part of t gcs ) and controlling the rate of change of the current driven in the coils. for consistency, note that the dot on the coil is always connected to the + pin in the coil driver, or, in the case of the half h-bridge driver, it is connected to the positive supply pin. the internal resistor r i is used to measure how much current is flowing in the coil. the op-amp shown in this diagram is actually built only once and is shared among all 12 coil drivers through a multiplexer to reduce manufacturing variability among drivers. to determine what voltage must come from the d/a output, the maximum current level set by the external r max resistor is converted to a reference voltage input to the d/a. this reference voltage sets the maximum output voltage of the d/a (with an input of $ff). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
gauge drivers coil drivers mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required figure 15-2. full h-bridge coil driver figure 15-3. half h-bridge coil driver control logic maja1- maja1+ maja2+ maja2 - v gsup s and h direction bit + - gauge coils all components are internal except the gauge coils r i from d/a shared among all coil drivers input mux = v ssg r coil l coil current sense mux d/a amp mina2+ mina2- v gsup = v ssg s and h gauge coils all components are external except the gauge coils r i mina1 + - from d/a shared among all coil drivers input mux v ssg r coil l coil current sense mux d/a amp control logic f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers 15.5 technical note an auto-zeroing scheme is implemented in the mc68hc705v12 to reduce errors internal to the chip. prior to each coil update, during the auto-zero phase, the amplifier output is disconnected from all fet gates (see figure 15-2 ) while the input is connected to its new input voltage. on completion of the auto-zero cycle, the amplifier output is connected to the appropriate fet gate. since the fet gate and amplifier output are typically not at the same potential, the fet gate is momentarily pulled down, until the amplifier control loop re-establishes the correct gate potential. this abrupt change in gate potential results in voltage spikes, and thus current spikes in the gauge coil. the magnitude, duration, and number of spikes are dependent on the coil resistance, gauge supply voltage (v gsup ), and the coil current prior to the auto-zero cycle ( figure 15-4 ). only the worst case spike durations, under the specified test conditions, are shown. typically the spike duration and total spike duration is smaller. note: due to the positive and negative spikes, there is negligible d.c. error introduced. figure 15-4. specification for current spikes t 1 t 2 i 0 i 1 i 1 t max i 0 = current before spikes i 1 = maximum spike magnitude =(v gsup + 0.9 v)/r coil t 1 = maximum negative spike duration = 300 m s t 2 = maximum positive spike duration = 200 m s t max = maximum duration of all spikes = 500 m s conditions: v gsup = 8.00 v l coil = 30 mh r coil = 200 w (typical) t a = 27 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
gauge drivers gauge driver control registers mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required 15.6 gauge driver control registers the gauge driver module requires the use of four types of control registers: ? the gauge enable register enables or disables individual gauges. ? the current magnitude registers set the amount of current to flow in a particular coil. ? the current direction register determines which direction the current will flow in a coil. ? the scan control register controls how the 12 coil drivers will be sequenced and updated by the analog multiplexers and control logic. each register is described in more detail in the following sections. 15.6.1 gauge enable register all bits in this register are used to select which of the six gauges will be driven when the gauge module is active. if any bit of bits 7-2 is set, the gauge module will become active. when all bits are cleared, the gauge module is considered off. as much circuitry as possible is shut off to conserve power. the d/a, the coil sequencing logic, and the coil current measurement circuits are turned off. all high-side drivers in the h-bridge drivers are left on to absorb any transient current that may be generated when the drivers are initially turned on or off; all low-side drivers are high-z. the effects of these bits on the scanning sequence of the gauges are described in 15.7 coil sequencer and control f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers mjaon major gauge a on bit this bit controls whether major gauge a is on or off. 1 = gauge is on. 0 = gauge is off. mjbon major gauge b on bit this bit controls whether major gauge b is on or off. 1 = gauge is on. 0 = gauge is off. miaon minor gauge a on bit this bit controls whether minor gauge a is on or off. 1 = gauge is on. 0 = gauge is off. mibon minor gauge b on bit this bit controls whether minor gauge b is on or off. 1 = gauge is on. 0 = gauge is off. micon minor gauge c on bit this bit controls whether minor gauge c is on or off. 1 = gauge is on. 0 = gauge is off. midon minor gauge d on bit this bit controls whether minor gauge d is on or off. 1 = gauge is on. 0 = gauge is off. $20 bit 7 654321 bit 0 read: mjaon mjbon miaon mibon micon midon cmps r write: reset: 00000000 r = reserved figure 15-5. gauge enable register (ger) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
gauge drivers gauge driver control registers mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required cmps feedback compensation select this bit is provided to enable the user to select between one of two gauge driver feedback paths, depending upon the characteristics of the load. 1 = alternate feedback circuit 0 = default feedback circuit 15.6.2 current magnitude registers addr. register read/ write bit 7 6 5 4 3 2 1 bit 0 $22 magnitude register - maja1 r b7 b6 b5 b4 b3 b2 b1 b0 w $23 magnitude register - maja2 r b7 b6 b5 b4 b3 b2 b1 b0 w $24 magnitude register - majb1 r b7 b6 b5 b4 b3 b2 b1 b0 w $25 magnitude register - majb2 r b7 b6 b5 b4 b3 b2 b1 b0 w $26 magnitude register - mina1 r b7 b6 b5 b4 b3 b2 b1 b0 w $27 magnitude register - mina2 r b7 b6 b5 b4 b3 b2 b1 b0 w $28 magnitude register - minb1 r b7 b6 b5 b4 b3 b2 b1 b0 w $29 magnitude register - minb2 r b7 b6 b5 b4 b3 b2 b1 b0 w $2a magnitude register - minc1 r b7 b6 b5 b4 b3 b2 b1 b0 w $2b magnitude register - minc2 r b7 b6 b5 b4 b3 b2 b1 b0 w $2c magnitude register - mind1 r b7 b6 b5 b4 b3 b2 b1 b0 w $2d magnitude register - mind2 r b7 b6 b5 b4 b3 b2 b1 b0 w figure 15-6. current magnitude registers f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers the naming convention used in the cmrs above indicates whether it is a major or minor gauge driver, which major or minor gauge (a, b, c, etc.), and which coil within the gauge is affected (coil 1 or coil 2). each of the magnitude registers is double buffered to keep both coil currents within the same gauge as closely coupled as possible. transfer of data from the master to the slave buffers in these registers is under control of the coil sequencer and control logic and is described in 15.7 coil sequencer and control . a read of any of the cmrs will return only the contents of the slave buffer. if a read of one of the cmrs takes place after a write of data but before the master-to-slave transfer takes place, the data read may be different from the data written. the master register will always hold the contents of the last write. reset clears all bits. the 8-bit value written to these registers will determine the amount of current that will flow in each of the 12 coils. for example, maja1 controls the magnitude of the current between the maja1+ and maja1 - pins. the theoretical current that will flow between the + and - pins is given by this equation: i cm is the maximum current that can be driven into any of the coil drivers and is given by this equation: i cm = (i max x 10) x (1 + e ca + e max ) e ca is the total internal error in generating i cm from i max and is shown in 17.11 gauge driver electricals . the e max is the error tolerance of the r max resistor and is shown in 17.11 gauge driver electricals . the reg value is the base 10 representation of the value written to the magnitude registers. i max is set by the external resistor and is a reference current that is used to generate the coil currents. i max is related to the external r max resistor by the equation: i icm () x reg value 255 ------------------------ ? ?? ? ?? = imax 2.5 rmax ----------------- - ? ?? x4 = f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
gauge drivers gauge driver control registers mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required 15.6.3 current direction registers the bits in these registers control the direction of current flow in each of the full eight h-bridge drive outputs. note that only coil 2 in the minor gauges requires a direction bit. since coil 1 in each of the minor gauges is a half h-bridge driver, it only requires a current magnitude register. the cdr also contains a master and slave latch. a read of any of these registers will return the value in the slave buffer. 15.6.3.1 current direction register for major a dmja1 and dmja2 current direction bits for major gauge a 1 = current flow will be from the C pin to the + pin on the corresponding coil driver. 0 = current flow will be from the + pin to the C pin on the corresponding coil driver. $2e bit 7 654321 bit 0 read: rrrrr0 dmja1 dmja2 write: reset: 00000000 r = reserved figure 15-7. maja current direction register (dmaja) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers 15.6.3.2 current direction register for major b dmjb1 and dmjb2 current direction bits for major gauge b 1 = current flow will be from the C pin to the + pin on the corresponding coil driver. 0 = current flow will be from the + pin to the C pin on the corresponding coil driver. 15.6.3.3 current direction register for minor a dmia current direction bit for minor gauge a 1 = current flow will be from the C pin to the + pin on the corresponding coil driver. 0 = current flow will be from the + pin to the C pin on the corresponding coil driver. $2f bit 7 654321 bit 0 read: 000000 dmjb1 dmjb2 write: reset: 00000000 figure 15-8. majb current direction register (dmajb) $30 bit 7 654321 bit 0 read: 0000000 dmia write: reset: 00000000 figure 15-9. mina current direction register (dmina) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
gauge drivers gauge driver control registers mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required 15.6.3.4 current direction register for minor b dmib current direction bit for minor gauge b 1 = current flow will be from the C pin to the + pin on the corresponding coil driver. 0 = current flow will be from the + pin to the C pin on the corresponding coil driver. 15.6.3.5 current direction register for minor c dmic current direction bit for minor gauge c 1 = current flow will be from the C pin to the + pin on the corresponding coil driver. 0 = current flow will be from the + pin to the C pin on the corresponding coil driver. $31 bit 7 654321 bit 0 read: 0000000 dmib write: reset: 00000000 figure 15-10. minb current direction register (dminb) $32 bit 7 654321 bit 0 read: 0000000 dmic write: reset: 00000000 figure 15-11. minc current direction register (dminc) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers 15.6.3.6 current direction register for minor d dmid current direction bit for minor gauge d 1 = current flow will be from the C pin to the + pin on the corresponding coil driver. 0 = current flow will be from the + pin to the C pin on the corresponding coil driver. 15.7 coil sequencer and control as shown in figure 15-1 the digital/analog converter is shared among all 12 coils. the sequence in which the coils are scanned and the events that take place during the scanning process are described in this section. the scan control and status register in 15.7.2 scan status and control register controls how the coil sequencer will operate. this register contains control bits that affect how the gauge sequencer will scan through the six gauges as well as a status bit to indicate where the scanning sequencer is in the scanning operation. 15.7.1 scanning sequence description the coil sequencer can be operated in two basic modes: automatic or manual. in either mode, each coil is updated by the d/a, muxes, and sample and hold circuits in the sequence shown in figure 15-1 . one time through the coil sequence is referred to as a scan cycle. it takes a time, t gcs, to update each coil during the scanning sequence. since there are 12 coils in the six gauge drivers, it will take a time, 12*t gcs, to complete one scan cycle. the differences between the automatic and manual modes are as follows. $33 bit 7 654321 bit 0 read: 0000000 dmid write: reset: 00000000 figure 15-12. mind current direction register (dmind) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
gauge drivers coil sequencer and control mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required 15.7.1.1 automatic mode once all of the coils have been updated, the sequence repeats automatically. the transfer of data in the cmr and cdrs master-to- slave buffers is performed at the beginning of each gauge update time. when one of the coil registers associated with a gauge is written, the second register also must be written before either value will be used. the coil registers may be written in either order. for example, if the mind1 register is written with any value, then the mind2 register must also be written. otherwise, minor gauge d will not be updated on subsequent scans and the currents driven into the coils will maintain their previously programmed values. this sequence must be followed even if the data written to one magnitude register is not different from the data already in the register. the hardware works off the write operation to the registers, not off the data written. before the master-to-slave transfer takes place in the cdrs, each coil in a particular gauge must be updated. because writes to the cmrs are the only requirement for transferring master to slave of the cdrs, the cdrs should be written before the cmrs are written. 15.7.1.2 manual mode the user must set the scns bit in the scan status and control register (sscr) to initiate a scan cycle. once a single scan cycle takes place, the coil sequencer stops and waits for the scns bit to be set again before starting another scan cycle. the scns bit must be set at a fast enough rate (the scan period) to prevent the sample and hold circuits from drooping and introducing error and current fluctuations into the output currents. this minimum time is called the minimum scan period, t msn (see 17.11 gauge driver electricals ). the transfer of data from the cmr and cdrs master-to-slave buffers is performed at the beginning of each gauge update time even if all cmrs and cdrs were not updated. if any of the gauges are turned off by clearing the appropriate bits in the gauge enable register (ger), the time the coil sequencer would have spent updating the coils in the disabled gauge is still expended, but the f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers coil driver remains off. this provides for a consistent scan rate regardless of the number of gauges that are enabled. the scanning sequence for the coils is shown in table 15-1 . it takes a time, t gcs , to update each coil. this includes time to move the data from the cmr and cdr (automatic mode), perform the digital/analog conversion, update the sample and hold circuit at the coil driver, and wait for all transient currents to settle for each coil. because several cpu write operations may be necessary to write to the cmrs and cdrs, all of the cmrs and the cdrs contain a master and a slave buffer to help prevent unwanted fluctuations in coil currents between the writes to the three registers on a given gauge. only the slave buffers will affect the coil currents and direction. table 15-1. coil scanning sequencer coil number coil name gauge name 1 maja1 major a 2 maja2 major a 3 majb1 major b 4 majb2 major b 5 mina1 minor a 6 mina2 minor a 7 minb1 minor b 8 minb2 minor b 9 minc1 minor c 10 minc2 minor c 11 mind1 minor d 12 mind2 minor d f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
gauge drivers coil sequencer and control mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required for coil currents to remain as consistent as possible during the scanning and updating of the gauge coil currents, the sample and hold update operation must take place in a particular way. the control logic will perform this function. when the scanning control logic is ready to advance to the next coil, this operations sequence must take place: 1. open all sample and hold switches. 2. increment pointer to next cmr slave register. if both cmrs for this gauge have been written, transfer new master data to slave buffer for this cmr and corresponding cdr. if both cmrs have not been written, dont transfer data from master to slave. 3. move slave buffer data to the d/a input. 4. wait for the d/a output to muxes. 5. close sample and hold mux and update direction control from cdr. 6. wait for sample and hold to settle. 7. go back to step 1 above. 15.7.2 scan status and control register although the cdr and cmrs can be written at any time, the user may want to write the cdr and cmrs at a particular time in the scanning sequence. some of the bits in the sscr give the user the information need to synchronize the writes to the cdr and cmrs with the coil sequencer. in addition to the sychronization bits, this register also contains a bit that affects the type of scanning that will take place (automatic or manual) and a bit to initiate a scan cycle manually when using manual mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers synie synchronize interrupt enable bit when this bit is set, an interrupt signal will be sent to the cpu when the synf bit is set. the i bit in the cpu condition code register must be cleared in order for the interrupt to be recognized by the cpu. the interrupt vector assigned to the gauge module is shown in table 15-2 . 1 = interrupt is enabled. 0 = interrupt is disabled. synf synchronize flag bit this bit is a read-only status bit and indicates that the coil sequencer has begun to service coil 11 (minor d). at this point in the scanning cycle, it is safe to write any of the cmrs or cdrs without affecting the current scan cycle. any time this bit is set and the synie bit is set, a cpu interrupt will be generated. the bit will be set even if minor d is not enabled in the ger, since the scanning sequence time is not affected by the enabling or disabling of the gauges. this bit will function in either auto or manual mode and does not affect the scanning operation in any way. it serves only as a status flag. note that once this bit is set, the software will have a time, 2*t gcs, to update the cdr and cmr register if new data is to be used in the next scan cycle. the bit is cleared by writing a 1 to the synr bit and by reset. synr synchronize flag reset bit this bit is used to clear the synf bit. writing a 1 to this bit will clear the synf bit if the synf bit was set during a read of the sscr. this bit will always read 0. $21 bit 7 654321 bit 0 read: synie synf 0 r gcs1 gcs0 scns autos write: synr reset: 00000000 = unimplemented r = reserved figure 15-13. scan status and control register (sscr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
gauge drivers coil sequencer and control mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required gcs1Cgcs0 gauge clock select bits these bits determine the clock divide ratio for the clock used by the scan sequencer. this provides for the use of several different system clock rates while still providing the gauge driver module with the same scanning rate. scns scan start bit when the coil sequencer is being operated in manual mode, this bit is used to initiate a scan cycle. setting this bit starts the scan cycle. all cmrs and cdrs will transfer data from the master to the slave when this bit is set. this bit clears automatically once the scan cycle begins to service coil 11 (minor d). the bit will clear at the proper time, even if the minor d gauge is not enabled in the ger, since the scan cycle time is not affected by the enabling or disabling of the gauges. the bit is cleared once coil 11 begins to be serviced because adequate time (2 * t gcs ) for the software (either interrupt driven or polled) to recognize the flag and write new data to the cdr and cmr registers for the next scan cycle should be provided. note that after the scan cycle has finished, a new scan cycle will not begin until this bit is set again. if a 1 is written to this bit before it clears, the write will be ignored. in automatic mode, this bit has no effect. table 15-2. gauge module clock select bits cpu bus clock frequency gcs1 gcs0 division scan cycle time f op = 0.5 mhz 0 0 512 t gcs f op = 1.0 mhz 0 1 1024 t gcs f op = 2.0 mhz 1 0 2048 t gcs f op = 4.0 mhz (see note) 1 1 4096 t gcs note: must not be selected f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers autos automatic mode select bit this bit selects whether the coil sequencer will operate in manual or automatic mode. 1 = automatic mode 0 = manual mode 15.8 mechanism diagram the diagram in figure 15-15 shows one way the gauge coils could be connected to the coil driver pins and how some of the other pins should be connected. the external components that have actual part numbers are merely examples of suitable components. other components with similar operating characteristics also may be used. 15.9 gauge power supply the mc68HC05V12 contains most of the circuitry to provide the coil drivers with a regulated supply that is necessary to drive the coil. referring to figure 15-3 , the gauge drive voltage, v gsup , is derived with the aid of an external p-channel enhancement mode mosfet device which serves as the series pass devices between a +12 v supply and the v gsup pin. two external resistors also are used to set the level of v gsup. the drive to the gate of the external pass devices will be whatever is required to produce a v gvref voltage of 2.5. the value of resistors r g1 and r g2 should be chosen so that v gsup * [r g2 /(r g1 +r g2 )] = 2.5 note: the v gsup pin requires a 100 m f low esr capacitor for regulator stability. in addition, the v dd and v cca pins should have the usual 0.1 m f bypass capacitors to v ss and v ssa respectively. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
gauge drivers gauge power supply mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required figure 15-14. sample gauge connections to the mc68HC05V12 v batt external regulator +5 volts +/-5% 0.1 m i max r max v dd v cca v ss v ssa 68HC05V12 v ssg v ss 0.1 m v gsup v pgc v gvref 1% mina1 mina2+ mina2 - minor gauge a maja1+ maja1 - maja2+ maja2 - major gauge a majb1+ majb1 - majb2+ majb2 - major gauge b minor gauge b minor gauge c minor gauge d minb1 minb2+ minb2 - minc1 minc2+ minc2 - mind1 mind2+ mind2 - r g1 r g2 100 mf circuitry 0.1 mf 0.1 m v dd ~8 v 0.1 mf *100k 5% low esr mtp2955 recommended 0.1 m f p6ke15a p6ke30a 1n5822 reverse battery and transient protection recommended values rg1 - 55 k rg2 - 25 k *r = pmos v t(nom) /50 x 10 C6 note: pass device and related components should be as physically close to the mcu as possible. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers to provide effective decoupling and to reduce radiated rf emissions, the small decoupling capacitors must be located as close to the supply pins as possible. the self-inductance of these capacitors and the parasitic inductance and capacitance of the interconnecting traces determine the self-resonant frequency of the decoupling network. too low a frequency will reduce decoupling effectiveness and could increase radiated rf emissions from the system. a low-value capacitor (470 pf to 0.01 m f) placed in parallel with the other capacitors will improve the bandwidth and effectiveness of the network. 15.10 gauge regulator accuracy the on-chip portion of the regulator will contribute no more than e gs % to the variation in the v gsup voltage. the remaining errors will come from the tolerances in the r g1 and r g2 resistors off-chip. 15.11 coil current accuracy the accuracy of the current flowing between the + and C coil pins of a particular coil driver pin pair is described here. matching of currents between coils within the same gauge is specified in 17.11 gauge driver electricals as e cm . the absolute accuracy of the coil current that can be driven into any coil is determined by the accuracy of i cm given by the equations in 15.10 gauge regulator accuracy and will be a total of (e ca + e max ). because the d/a amp is shared among all coil drivers and between both sets of drivers in the full h-bridge drivers, there will be no difference in the magnitude of the current when the magnitude register value remains constant and only the polarity bit is changed in a coil driver. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
gauge drivers external component considerations mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required 15.12 external component considerations to determine the values and tolerances of the external components required to drive the air core gauge coils, the minimum v batt voltage, at the v12 pin, and the power dissipation should be considered. figure 15-15 shows the components in the path between the +12 v coming in through the external devices the internal devices and into v ssg . figure 15-15. coil driver current path 1n5822 gauge coils r i v ssg pad +12 v v gsup coil driver pad coil driver pad r coil l coil v diode + - v pass + - pin on package f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers 15.12.1 minimum voltage operation to maintain accuracy to as low a v batt voltage as possible, the following equations should be used to calculate the range of values for the external components. v batt(min) = v gsup(max) + v diode + v pass v pass is the drop across the external p-channel mosfet at sf * 12 * i coil(max) sf = % of max current driven by all coil drivers in application. worst case 0.707 (45 o ) assumes sin/cos drive algorithm. v diode = drop across reverse battery protection diode at 12 * i coil(max) to solve the above equation, the factors involved in generating the gauge supply voltage, v gsup , must first be calculated due to both internal tolerances and the tolerances of external resistors r g1 and r g2 , v gsup = v gsup(nom) x (1 t ol ) v gsup(nom) is the v gsup voltage generated with all tolerances set to 0%. t ol = e gs + t ol(rg1) + t ol(rg2) and includes temperature effects. r g1 and r g2 are the external resistors used to set the v gsup voltage. the internal tolerances are e gs . the minimum v gsup voltage required for proper operation is given by, i coil(max) x [r coil(max) + r si(max) ] where ?r si is the total of the internal resistances from the transistors and sense resistor and is found in the electrical specifications. ?i coil is the minimum required coil current. ?r coil is the minimum coil resistance including temperature effects. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
gauge drivers external component considerations mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required the minimum required v gsup must agree with the minimum generated v gsup of, v gsup(min) = v gsup(nom) x (1-t ol ) equating the two v gsup(nom) x (1-t ol ) = i coil(max) x [ r coil(max) + r si(max) ] 15.12.2 power dissipation to keep the junction temperature to a minimum, the power consumed by the gauge drivers must be factored into the chip power dissipation equation. the total chip power dissipation combined with the thermal resistance of the package cannot exceed the maximum junction temperature, t j . the total chip power dissipation is given by this equation: p d = p gauge + p chip p chip is the power contribution by all chip modules that are connected to the v dd and v dda sources including part of the gauge module. to calculate p chip , use this equation: p chip = (i dd xv dd ) + (i cca x v cca ) vgsup nom () icoil max () x rcoil max () rsi max () + [] 1 tol C () ----------------------------------------------------------------------------------------------------------------- - = f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers the power dissipation contributed by the gauge module is given by this equation. p gauge = [v gsup(max) x i gsup ] + p gdrivers where p gdrivers = [(v gsup(max) x i coil(max) ) C (i coil(max) 2 x r coil(min) )] x 12 x sf where ?i gsup = the current consumed by the gauge module from the v gsup pin for functions other than generating coil currents. ? 12 is the number of coil drivers ? sf = % of max current driven in any coil; worse case for power dissipation purposes, 0.707 (45 o ) assumes sin/cos drive algorithm ?i coil(max) = maximum required coil current in each coil 15.12.3 coil inductance limits since the mcu pins will drive the gauge coils directly without any external voltage limiting devices, precautions must be taken to avoid generating voltages and currents high enough to damage the mcu. the high voltages generated by the inductive impedance of the coil will be related directly to the coil drivers. this imposes a limit on the maximum coil inductance referred to as l coil in the electrical specifications. 15.13 operation in wait mode during wait mode, the gauge driver module will continue to operate normally. the gauges will continue to be driven to the currents and directions that were last written to the cmr and cdr. in manual mode, if the cpu will be put into wait mode between scan cycles, the synie bit in the sscr should be set to enable the gauge module to generate an interrupt request (which will take the cpu out of wait mode) to properly service the gauge coils. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
gauge drivers operation in stop mode mc68HC05V12 rev. 1.0 general release specification gauge drivers non-disclosure agreement required 15.14 operation in stop mode during stop mode, the system clocks will stop operating. all bits in the ger register will be cleared automatically when stop mode is entered. no other bits in any other gauge module registers will be affected. the gauge controller sequence and control logic will be reset/initialized such that a new scan sequence will begin once the gauges are turned on during the users stop mode recovery sequence. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required gauge drivers general release specification mc68HC05V12 rev. 1.0 gauge drivers f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification instruction set non-disclosure agreement required general release specification mc68HC05V12 section 16. instruction set 16.1 contents 16.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .202 16.3 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .202 16.3.1 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203 16.3.2 immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203 16.3.3 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203 16.3.4 extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203 16.3.5 indexed, no offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204 16.3.6 indexed, 8-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204 16.3.7 indexed,16-bit offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . .204 16.3.8 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205 16.4 instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205 16.4.1 register/memory instructions . . . . . . . . . . . . . . . . . . . . . .206 16.4.2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . .207 16.4.3 jump/branch instructions . . . . . . . . . . . . . . . . . . . . . . . . .208 16.4.4 bit manipulation instructions . . . . . . . . . . . . . . . . . . . . . . .210 16.4.5 control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .211 16.5 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .212 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required instruction set general release specification mc68HC05V12 rev. 1.0 instruction set 16.2 introduction the mcu instruction set has 62 instructions and uses eight addressing modes. the instructions include all those of the m146805 cmos family plus one more: the unsigned multiply (mul) instruction. the mul instruction allows unsigned multiplication of the contents of the accumulator (a) and the index register (x). the high-order product is stored in the index register, and the low-order product is stored in the accumulator. 16.3 addressing modes the cpu uses eight addressing modes for flexibility in accessing data. the addressing modes provide eight different ways for the cpu to find the data required to execute an instruction. the eight addressing modes are: ? inherent ? immediate ? direct ? extended ? indexed, no offset ? indexed, 8-bit offset ? indexed, 16-bit offset ? relative f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
instruction set addressing modes mc68HC05V12 rev. 1.0 general release specification instruction set non-disclosure agreement required 16.3.1 inherent inherent instructions are those that have no operand, such as return from interrupt (rti) and stop (stop). some of the inherent instructions act on data in the cpu registers, such as set carry flag (sec) and increment accumulator (inca). inherent instructions require no operand address and are one byte long. 16.3.2 immediate immediate instructions are those that contain a value to be used in an operation with the value in the accumulator or index register. immediate instructions require no operand address and are two bytes long. the opcode is the first byte, and the immediate data value is the second byte. 16.3.3 direct direct instructions can access any of the first 256 memory locations with two bytes. the first byte is the opcode, and the second is the low byte of the operand address. in direct addressing, the cpu automatically uses $00 as the high byte of the operand address. 16.3.4 extended extended instructions use three bytes and can access any address in memory. the first byte is the opcode; the second and third bytes are the high and low bytes of the operand address. when using the motorola assembler, the programmer does not need to specify whether an instruction is direct or extended. the assembler automatically selects the shortest form of the instruction. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required instruction set general release specification mc68HC05V12 rev. 1.0 instruction set 16.3.5 indexed, no offset indexed instructions with no offset are 1-byte instructions that can access data with variable addresses within the first 256 memory locations. the index register contains the low byte of the effective address of the operand. the cpu automatically uses $00 as the high byte, so these instructions can address locations $0000C$00ff. indexed, no offset instructions are often used to move a pointer through a table or to hold the address of a frequently used ram or i/o location. 16.3.6 indexed, 8-bit offset indexed, 8-bit offset instructions are 2-byte instructions that can access data with variable addresses within the first 511 memory locations. the cpu adds the unsigned byte in the index register to the unsigned byte following the opcode. the sum is the effective address of the operand. these instructions can access locations $0000C$01fe. indexed 8-bit offset instructions are useful for selecting the kth element in an n-element table. the table can begin anywhere within the first 256 memory locations and could extend as far as location 510 ($01fe). the k value is typically in the index register, and the address of the beginning of the table is in the byte following the opcode. 16.3.7 indexed,16-bit offset indexed, 16-bit offset instructions are 3-byte instructions that can access data with variable addresses at any location in memory. the cpu adds the unsigned byte in the index register to the two unsigned bytes following the opcode. the sum is the effective address of the operand. the first byte after the opcode is the high byte of the 16-bit offset; the second byte is the low byte of the offset. indexed, 16-bit offset instructions are useful for selecting the kth element in an n-element table anywhere in memory. as with direct and extended addressing, the motorola assembler determines the shortest form of indexed addressing. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
instruction set instruction types mc68HC05V12 rev. 1.0 general release specification instruction set non-disclosure agreement required 16.3.8 relative relative addressing is only for branch instructions. if the branch condition is true, the cpu finds the effective branch destination by adding the signed byte following the opcode to the contents of the program counter. if the branch condition is not true, the cpu goes to the next instruction. the offset is a signed, twos complement byte that gives a branching range of C128 to +127 bytes from the address of the next location after the branch instruction. when using the motorola assembler, the programmer does not need to calculate the offset, because the assembler determines the proper offset and verifies that it is within the span of the branch. 16.4 instruction types the mcu instructions fall into the following five categories: ? register/memory instructions ? read-modify-write instructions ? jump/branch instructions ? bit manipulation instructions ? control instructions f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required instruction set general release specification mc68HC05V12 rev. 1.0 instruction set 16.4.1 register/memory instructions these instructions operate on cpu registers and memory locations. most of them use two operands. one operand is in either the accumulator or the index register. the cpu finds the other operand in memory. table 16-1. register/memory instructions instruction mnemonic add memory byte and carry bit to accumulator adc add memory byte to accumulator add and memory byte with accumulator and bit test accumulator bit compare accumulator cmp compare index register with memory byte cpx exclusive or accumulator with memory byte eor load accumulator with memory byte lda load index register with memory byte ldx multiply mul or accumulator with memory byte ora subtract memory byte and carry bit from accumulator sbc store accumulator in memory sta store index register in memory stx subtract memory byte from accumulator sub f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
instruction set instruction types mc68HC05V12 rev. 1.0 general release specification instruction set non-disclosure agreement required 16.4.2 read-modify-write instructions these instructions read a memory location or a register, modify its contents, and write the modified value back to the memory location or to the register. note: do not use read-modify-write operations on write-only registers. 1. unlike other read-modify-write instructions, bclr and bset use only direct addressing. 2. tst is an exception to the read-modify-write sequence be- cause it does not write a replacement value. table 16-2. read-modify-write instructions instruction mnemonic arithmetic shift left (same as lsl) asl arithmetic shift right asr bit clear bclr (1) bit set bset (1) clear register clr complement (ones complement) com decrement dec increment inc logical shift left (same as asl) lsl logical shift right lsr negate (twos complement) neg rotate left through carry bit rol rotate right through carry bit ror test for negative or zero tst (2) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required instruction set general release specification mc68HC05V12 rev. 1.0 instruction set 16.4.3 jump/branch instructions jump instructions allow the cpu to interrupt the normal sequence of the program counter. the unconditional jump instruction (jmp) and the jump-to-subroutine instruction (jsr) have no register operand. branch instructions allow the cpu to interrupt the normal sequence of the program counter when a test condition is met. if the test condition is not met, the branch is not performed. the brclr and brset instructions cause a branch based on the state of any readable bit in the first 256 memory locations. these 3-byte instructions use a combination of direct addressing and relative addressing. the direct address of the byte to be tested is in the byte following the opcode. the third byte is the signed offset byte. the cpu finds the effective branch destination by adding the third byte to the program counter if the specified bit tests true. the bit to be tested and its condition (set or clear) is part of the opcode. the span of branching is from C128 to +127 from the address of the next location after the branch instruction. the cpu also transfers the tested bit to the carry/borrow bit of the condition code register. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
instruction set instruction types mc68HC05V12 rev. 1.0 general release specification instruction set non-disclosure agreement required table 16-3. jump and branch instructions instruction mnemonic branch if carry bit clear bcc branch if carry bit set bcs branch if equal beq branch if half-carry bit clear bhcc branch if half-carry bit set bhcs branch if higher bhi branch if higher or same bhs branch if irq pin high bih branch if irq pin low bil branch if lower blo branch if lower or same bls branch if interrupt mask clear bmc branch if minus bmi branch if interrupt mask set bms branch if not equal bne branch if plus bpl branch always bra branch if bit clear brclr branch never brn branch if bit set brset branch to subroutine bsr unconditional jump jmp jump to subroutine jsr f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required instruction set general release specification mc68HC05V12 rev. 1.0 instruction set 16.4.4 bit manipulation instructions the cpu can set or clear any writable bit in the first 256 bytes of memory, which includes i/o registers and on-chip ram locations. the cpu can also test and branch based on the state of any bit in any of the first 256 memory locations. table 16-4. bit manipulation instructions instruction mnemonic bit clear bclr branch if bit clear brclr branch if bit set brset bit set bset f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
instruction set instruction types mc68HC05V12 rev. 1.0 general release specification instruction set non-disclosure agreement required 16.4.5 control instructions these instructions act on cpu registers and control cpu operation during program execution. table 16-5. control instructions instruction mnemonic clear carry bit clc clear interrupt mask cli no operation nop reset stack pointer rsp return from interrupt rti return from subroutine rts set carry bit sec set interrupt mask sei stop oscillator and enable irq pin stop software interrupt swi transfer accumulator to index register tax transfer index register to accumulator txa stop cpu clock and enable interrupts wait f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required instruction set general release specification mc68HC05V12 rev. 1.0 instruction set 16.5 instruction set summary table 16-6. instruction set summary source form operation description effect on ccr address mode opcode operand cycles hinzc adc # opr adc opr adc opr adc opr ,x adc opr ,x adc ,x add with carry a ? (a) + (m) + (c) imm dir ext ix2 ix1 ix a9 b9 c9 d9 e9 f9 ii dd hh ll ee ff ff 2 3 4 5 4 3 add # opr add opr add opr add opr ,x add opr ,x add ,x add without carry a ? (a) + (m) imm dir ext ix2 ix1 ix ab bb cb db eb fb ii dd hh ll ee ff ff 2 3 4 5 4 3 and # opr and opr an d opr and opr ,x and opr ,x and ,x logical and a ? (a) (m) imm dir ext ix2 ix1 ix a4 b4 c4 d4 e4 f4 ii dd hh ll ee ff ff 2 3 4 5 4 3 asl opr asla aslx asl opr ,x asl ,x arithmetic shift left (same as lsl) dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 asr opr asra asrx asr opr ,x asr ,x arithmetic shift right dir inh inh ix1 ix 37 47 57 67 77 dd ff 5 3 3 6 5 bcc rel branch if carry bit clear pc ? (pc) + 2 + rel ? c = 0 rel 24 rr 3 bclr n opr clear bit n mn ? 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 11 13 15 17 19 1b 1d 1f dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bcs rel branch if carry bit set (same as blo) pc ? (pc) + 2 + rel ? c = 1 rel 25 rr 3 beq rel branch if equal pc ? (pc) + 2 + rel ? z = 1 rel 27 rr 3 bhcc rel branch if half-carry bit clear pc ? (pc) + 2 + rel ? h = 0 rel 28 rr 3 bhcs rel branch if half-carry bit set pc ? (pc) + 2 + rel ? h = 1 rel 29 rr 3 bhi rel branch if higher pc ? (pc) + 2 + rel ? c z = 0 rel 22 rr 3 bhs rel branch if higher or same pc ? (pc) + 2 + rel ? c = 0 rel 24 rr 3 c b0 b7 0 b0 b7 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
instruction set instruction set summary mc68HC05V12 rev. 1.0 general release specification instruction set non-disclosure agreement required bih rel branch if irq pin high pc ? (pc) + 2 + rel ? irq = 1 rel 2f rr 3 bil rel branch if irq pin low pc ? (pc) + 2 + rel ? irq = 0 rel 2e rr 3 bit # opr bit opr bit opr bit opr ,x bit opr ,x bit ,x bit test accumulator with memory byte (a) (m) imm dir ext ix2 ix1 ix a5 b5 c5 d5 e5 f5 ii dd hh ll ee ff ff 2 3 4 5 4 3 blo rel branch if lower (same as bcs) pc ? (pc) + 2 + rel ? c = 1 rel 25 rr 3 bls rel branch if lower or same pc ? (pc) + 2 + rel ? c z = 1 rel 23 rr 3 bmc rel branch if interrupt mask clear pc ? (pc) + 2 + rel ? i = 0 rel 2c rr 3 bmi rel branch if minus pc ? (pc) + 2 + rel ? n = 1 rel 2b rr 3 bms rel branch if interrupt mask set pc ? (pc) + 2 + rel ? i = 1 rel 2d rr 3 bne rel branch if not equal pc ? (pc) + 2 + rel ? z = 0 rel 26 rr 3 bpl rel branch if plus pc ? (pc) + 2 + rel ? n = 0 rel 2a rr 3 bra rel branch always pc ? (pc) + 2 + rel ? 1 = 1 rel 20 rr 3 brclr n opr rel branch if bit n clear pc ? (pc) + 2 + rel ? mn = 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 01 03 05 07 09 0b 0d 0f dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brn rel branch never pc ? (pc) + 2 + rel ? 1 = 0 rel 21 rr 3 brset n opr rel branch if bit n set pc ? (pc) + 2 + rel ? mn = 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 00 02 04 06 08 0a 0c 0e dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 bset n opr set bit n mn ? 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 10 12 14 16 18 1a 1c 1e dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bsr rel branch to subroutine pc ? (pc) + 2; push (pcl) sp ? (sp) C 1; push (pch) sp ? (sp) C 1 pc ? (pc) + rel rel ad rr 6 clc clear carry bit c ? 0 0 inh 98 2 cli clear interrupt mask i ? 0 0 inh 9a 2 table 16-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles hinzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required instruction set general release specification mc68HC05V12 rev. 1.0 instruction set clr opr clra clrx clr opr ,x clr ,x clear byte m ? $00 a ? $00 x ? $00 m ? $00 m ? $00 0 1 dir inh inh ix1 ix 3f 4f 5f 6f 7f dd ff 5 3 3 6 5 cmp # opr cmp opr cmp opr cmp opr ,x cmp opr ,x cmp ,x compare accumulator with memory byte (a) C (m) imm dir ext ix2 ix1 ix a1 b1 c1 d1 e1 f1 ii dd hh ll ee ff ff 2 3 4 5 4 3 com opr coma comx com opr ,x com ,x complement byte (ones complement) m ? ( m) = $ff C (m) a ? ( a) = $ff C (a) x ? ( x) = $ff C (x) m ? ( m) = $ff C (m) m ? ( m) = $ff C (m) 1 dir inh inh ix1 ix 33 43 53 63 73 dd ff 5 3 3 6 5 cpx # opr cpx opr cpx opr cpx opr ,x cpx opr ,x cpx ,x compare index register with memory byte (x) C (m) imm dir ext ix2 ix1 ix a3 b3 c3 d3 e3 f3 ii dd hh ll ee ff ff 2 3 4 5 4 3 dec opr deca decx dec opr ,x dec ,x decrement byte m ? (m) C 1 a ? (a) C 1 x ? (x) C 1 m ? (m) C 1 m ? (m) C 1 dir inh inh ix1 ix 3a 4a 5a 6a 7a dd ff 5 3 3 6 5 eor # opr eor opr eor opr eor opr ,x eor opr ,x eor ,x exclusive or accumulator with memory byte a ? (a) ? (m) imm dir ext ix2 ix1 ix a8 b8 c8 d8 e8 f8 ii dd hh ll ee ff ff 2 3 4 5 4 3 inc opr inca incx inc opr ,x inc ,x increment byte m ? (m) + 1 a ? (a) + 1 x ? (x) + 1 m ? (m) + 1 m ? (m) + 1 dir inh inh ix1 ix 3c 4c 5c 6c 7c dd ff 5 3 3 6 5 jmp opr jmp opr jmp opr ,x jmp opr ,x jmp ,x unconditional jump pc ? jump address dir ext ix2 ix1 ix bc cc dc ec fc dd hh ll ee ff ff 2 3 4 3 2 table 16-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles hinzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
instruction set instruction set summary mc68HC05V12 rev. 1.0 general release specification instruction set non-disclosure agreement required jsr opr jsr opr jsr opr ,x jsr opr ,x jsr ,x jump to subroutine pc ? (pc) + n (n = 1, 2, or 3) push (pcl); sp ? (sp) C 1 push (pch); sp ? (sp) C 1 pc ? effective address dir ext ix2 ix1 ix bd cd dd ed fd dd hh ll ee ff ff 5 6 7 6 5 lda # opr lda opr lda opr lda opr ,x lda opr ,x lda ,x load accumulator with memory byte a ? (m) imm dir ext ix2 ix1 ix a6 b6 c6 d6 e6 f6 ii dd hh ll ee ff ff 2 3 4 5 4 3 ldx # opr ldx opr ldx opr ldx opr ,x ldx opr ,x ldx ,x load index register with memory byte x ? (m) imm dir ext ix2 ix1 ix ae be ce de ee fe ii dd hh ll ee ff ff 2 3 4 5 4 3 lsl opr lsla lslx lsl opr ,x lsl ,x logical shift left (same as asl) dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 lsr opr lsra lsrx lsr opr ,x lsr ,x logical shift right 0 dir inh inh ix1 ix 34 44 54 64 74 dd ff 5 3 3 6 5 mul unsigned multiply x : a ? (x) (a) 0 0 inh 42 1 1 neg opr nega negx neg opr ,x neg ,x negate byte (twos complement) m ? C(m) = $00 C (m) a ? C(a) = $00 C (a) x ? C(x) = $00 C (x) m ? C(m) = $00 C (m) m ? C(m) = $00 C (m) dir inh inh ix1 ix 30 40 50 60 70 dd ff 5 3 3 6 5 nop no operation inh 9d 2 ora # opr ora opr ora opr ora opr ,x ora opr ,x ora ,x logical or accumulator with memory a ? (a) (m) imm dir ext ix2 ix1 ix aa ba ca da ea fa ii dd hh ll ee ff ff 2 3 4 5 4 3 rol opr rola rolx rol opr ,x rol ,x rotate byte left through carry bit dir inh inh ix1 ix 39 49 59 69 79 dd ff 5 3 3 6 5 table 16-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles hinzc c b0 b7 0 b0 b7 c 0 c b0 b7 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required instruction set general release specification mc68HC05V12 rev. 1.0 instruction set ror opr rora rorx ror opr ,x ror ,x rotate byte right through carry bit dir inh inh ix1 ix 36 46 56 66 76 dd ff 5 3 3 6 5 rsp reset stack pointer sp ? $00ff inh 9c 2 rti return from interrupt sp ? (sp) + 1; pull (ccr) sp ? (sp) + 1; pull (a) sp ? (sp) + 1; pull (x) sp ? (sp) + 1; pull (pch) sp ? (sp) + 1; pull (pcl) inh 80 9 rts return from subroutine sp ? (sp) + 1; pull (pch) sp ? (sp) + 1; pull (pcl) inh 81 6 sbc # opr sbc opr sbc opr sbc opr ,x sbc opr ,x sbc ,x subtract memory byte and carry bit from accumulator a ? (a) C (m) C (c) imm dir ext ix2 ix1 ix a2 b2 c2 d2 e2 f2 ii dd hh ll ee ff ff 2 3 4 5 4 3 sec set carry bit c ? 1 1 inh 99 2 sei set interrupt mask i ? 1 1 inh 9b 2 sta opr sta opr sta opr ,x sta opr ,x sta ,x store accumulator in memory m ? (a) dir ext ix2 ix1 ix b7 c7 d7 e7 f7 dd hh ll ee ff ff 4 5 6 5 4 stop stop oscillator and enable irq pin 0 inh 8e 2 stx opr stx opr stx opr ,x stx opr ,x stx ,x store index register in memory m ? (x) dir ext ix2 ix1 ix bf cf df ef ff dd hh ll ee ff ff 4 5 6 5 4 sub # opr sub opr sub opr sub opr ,x sub opr ,x sub ,x subtract memory byte from accumulator a ? (a) C (m) imm dir ext ix2 ix1 ix a0 b0 c0 d0 e0 f0 ii dd hh ll ee ff ff 2 3 4 5 4 3 swi software interrupt pc ? (pc) + 1; push (pcl) sp ? (sp) C 1; push (pch) sp ? (sp) C 1; push (x) sp ? (sp) C 1; push (a) sp ? (sp) C 1; push (ccr) sp ? (sp) C 1; i ? 1 pch ? interrupt vector high byte pcl ? interrupt vector low byte 1 inh 83 1 0 tax transfer accumulator to index register x ? (a) inh 97 2 table 16-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles hinzc b0 b7 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
instruction set instruction set summary mc68HC05V12 rev. 1.0 general release specification instruction set non-disclosure agreement required tst opr tsta tstx tst opr ,x tst ,x test memory byte for negative or zero (m) C $00 dir inh inh ix1 ix 3d 4d 5d 6d 7d dd ff 4 3 3 5 4 txa transfer index register to accumulator a ? (x) inh 9f 2 wait stop cpu clock and enable interrupts 0 inh 8f 2 a accumulator opr operand (one or two bytes) c carry/borrow ?ag pc program counter ccr condition code register pch program counter high byte dd direct address of operand pcl program counter low byte dd rr direct address of operand and relative offset of branch instruction rel relative addressing mode dir direct addressing mode rel relative program counter offset byte ee ff high and low bytes of offset in indexed, 16-bit offset addressing rr relative program counter offset byte ext extended addressing mode sp stack pointer ff offset byte in indexed, 8-bit offset addressing x index register h half-carry ?ag z zero ?ag hh ll high and low bytes of operand address in extended addressing # immediate value i interrupt mask logical and ii immediate operand byte logical or imm immediate addressing mode ? logical exclusive or inh inherent addressing mode ( ) contents of ix indexed, no offset addressing mode C( ) negation (twos complement) ix1 indexed, 8-bit offset addressing mode ? loaded with ix2 indexed, 16-bit offset addressing mode ? if m memory location : concatenated with n negative ?ag set or cleared n any bit not affected table 16-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles hinzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required general release specification mc68HC05V12 rev. 1.0 instruction set instruction set table 16-7. opcode map bit manipulation branch read-modify-write control register/memory dir dir rel dir inh inh ix1 ix inh inh imm dir ext ix2 ix1 ix 0123456789 abcdef 0 5 brset0 3 dir 5 bset0 2 dir 3 bra 2 rel 5 neg 2 dir 3 nega 1 inh 3 negx 1 inh 6 neg 2 ix1 5 neg 1ix 9 rti 1 inh 2 sub 2 imm 3 sub 2 dir 4 sub 3 ext 5 sub 3 ix2 4 sub 2 ix1 3 sub 1ix 0 1 5 brclr0 3 dir 5 bclr0 2 dir 3 brn 2 rel 6 rts 1 inh 2 cmp 2 imm 3 cmp 2 dir 4 cmp 3 ext 5 cmp 3 ix2 4 cmp 2 ix1 3 cmp 1ix 1 2 5 brset1 3 dir 5 bset1 2 dir 3 bhi 2 rel 11 mul 1 inh 2 sbc 2 imm 3 sbc 2 dir 4 sbc 3 ext 5 sbc 3 ix2 4 sbc 2 ix1 3 sbc 1ix 2 3 5 brclr1 3 dir 5 bclr1 2 dir 3 bls 2 rel 5 com 2 dir 3 coma 1 inh 3 comx 1 inh 6 com 2 ix1 5 com 1ix 10 swi 1 inh 2 cpx 2 imm 3 cpx 2 dir 4 cpx 3 ext 5 cpx 3 ix2 4 cpx 2 ix1 3 cpx 1ix 3 4 5 brset2 3 dir 5 bset2 2 dir 3 bcc 2 rel 5 lsr 2 dir 3 lsra 1 inh 3 lsrx 1 inh 6 lsr 2 ix1 5 lsr 1ix 2 and 2 imm 3 and 2 dir 4 and 3 ext 5 and 3 ix2 4 and 2 ix1 3 and 1ix 4 5 5 brclr2 3 dir 5 bclr2 2 dir 3 bcs/blo 2 rel 2 bit 2 imm 3 bit 2 dir 4 bit 3 ext 5 bit 3 ix2 4 bit 2 ix1 3 bit 1ix 5 6 5 brset3 3 dir 5 bset3 2 dir 3 bne 2 rel 5 ror 2 dir 3 rora 1 inh 3 rorx 1 inh 6 ror 2 ix1 5 ror 1ix 2 lda 2 imm 3 lda 2 dir 4 lda 3 ext 5 lda 3 ix2 4 lda 2 ix1 3 lda 1ix 6 7 5 brclr3 3 dir 5 bclr3 2 dir 3 beq 2 rel 5 asr 2 dir 3 asra 1 inh 3 asrx 1 inh 6 asr 2 ix1 5 asr 1ix 2 ta x 1 inh 4 sta 2 dir 5 sta 3 ext 6 sta 3 ix2 5 sta 2 ix1 4 sta 1ix 7 8 5 brset4 3 dir 5 bset4 2 dir 3 bhcc 2 rel 5 asl/lsl 2 dir 3 asla/lsla 1 inh 3 aslx/lslx 1 inh 6 asl/lsl 2 ix1 5 asl/lsl 1ix 2 clc 1 inh 2 eor 2 imm 3 eor 2 dir 4 eor 3 ext 5 eor 3 ix2 4 eor 2 ix1 3 eor 1ix 8 9 5 brclr4 3 dir 5 bclr4 2 dir 3 bhcs 2 rel 5 rol 2 dir 3 rola 1 inh 3 rolx 1 inh 6 rol 2 ix1 5 rol 1ix 2 sec 1 inh 2 adc 2 imm 3 adc 2 dir 4 adc 3 ext 5 adc 3 ix2 4 adc 2 ix1 3 adc 1ix 9 a 5 brset5 3 dir 5 bset5 2 dir 3 bpl 2 rel 5 dec 2 dir 3 deca 1 inh 3 decx 1 inh 6 dec 2 ix1 5 dec 1ix 2 cli 1 inh 2 ora 2 imm 3 ora 2 dir 4 ora 3 ext 5 ora 3 ix2 4 ora 2 ix1 3 ora 1ix a b 5 brclr5 3 dir 5 bclr5 2 dir 3 bmi 2 rel 2 sei 1 inh 2 add 2 imm 3 add 2 dir 4 add 3 ext 5 add 3 ix2 4 add 2 ix1 3 add 1ix b c 5 brset6 3 dir 5 bset6 2 dir 3 bmc 2 rel 5 inc 2 dir 3 inca 1 inh 3 incx 1 inh 6 inc 2 ix1 5 inc 1ix 2 rsp 1 inh 2 jmp 2 dir 3 jmp 3 ext 4 jmp 3 ix2 3 jmp 2 ix1 2 jmp 1ix c d 5 brclr6 3 dir 5 bclr6 2 dir 3 bms 2 rel 4 tst 2 dir 3 tsta 1 inh 3 tstx 1 inh 5 tst 2 ix1 4 tst 1ix 2 nop 1 inh 6 bsr 2 rel 5 jsr 2 dir 6 jsr 3 ext 7 jsr 3 ix2 6 jsr 2 ix1 5 jsr 1ix d e 5 brset7 3 dir 5 bset7 2 dir 3 bil 2 rel 2 stop 1 inh 2 ldx 2 imm 3 ldx 2 dir 4 ldx 3 ext 5 ldx 3 ix2 4 ldx 2 ix1 3 ldx 1ix e f 5 brclr7 3 dir 5 bclr7 2 dir 3 bih 2 rel 5 clr 2 dir 3 clra 1 inh 3 clrx 1 inh 6 clr 2 ix1 5 clr 1ix 2 wait 1 inh 2 txa 1 inh 4 stx 2 dir 5 stx 3 ext 6 stx 3 ix2 5 stx 2 ix1 4 stx 1ix f inh = inherent rel = relative imm = immediate ix = indexed, no offset dir = direct ix1 = indexed, 8-bit offset ext = extended ix2 = indexed, 16-bit offset 0 msb of opcode in hexadecimal lsb of opcode in hexadecimal 0 5 brset0 3 dir number of cycles opcode mnemonic number of bytes/addressing mode lsb msb lsb msb lsb msb f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification electrical specifications non-disclosure agreement required general release specification mc68HC05V12 section 17. electrical specifications 17.1 contents 17.2 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .220 17.3 operating temperature range. . . . . . . . . . . . . . . . . . . . . . . .221 17.4 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221 17.5 power considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .222 17.6 dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . .223 17.7 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .224 17.8 a/d converter characteristics . . . . . . . . . . . . . . . . . . . . . . . .226 17.9 lvr timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .227 17.10 serial peripheral interface (spi) timing . . . . . . . . . . . . . . . . .228 17.11 gauge driver electricals . . . . . . . . . . . . . . . . . . . . . . . . . . . . .230 17.12 bdlc electricals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .231 17.12.1 transmitter vpw symbol timings . . . . . . . . . . . . . . . . . .231 17.12.2 receiver vpw symbol timings . . . . . . . . . . . . . . . . . . . .231 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required electrical speci?cations general release specification mc68HC05V12 rev. 1.0 electrical specifications 17.2 maximum ratings maximum ratings are the extreme limits to which the mcu can be exposed without permanently damaging it. the mcu contains circuitry to protect the inputs against damage from high static voltages; however, do not apply voltages higher than those shown in the table below. keep v in and v out within the range v ss (v in or v out ) v dd . connect unused inputs to the appropriate voltage level, either v ss or v dd . note: this device is not guaranteed to operate properly at the maximum ratings. refer to 17.6 dc electrical characteristics for guaranteed operating conditions. rating symbol value unit supply voltage v pgc, v gsup, and v gref v dd v cca C0.5 to +42.0 C0.5 to +7.0 v dd v input voltage v in v ss C0.3 to v dd +0.3 v current drain per pin (i/o) current drain per pin (gauge) i 25 50 ma storage temperature range t stg C65 to +150 c write/erase cycles (@ 10 ms write time and C40 c, +25 c, and +85 c) 10,000 cycles data retention eeprom (C40 c, to + 85 c) 10 years f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
electrical specifications operating temperature range mc68HC05V12 rev. 1.0 general release specification electrical specifications non-disclosure agreement required 17.3 operating temperature range 17.4 thermal characteristics characteristic symbol value unit operating temperature range standard extended t a t l to t h 0 to +70 C40 to +85 c maximum junction temperature t j 150 c characteristic symbol value unit thermal resistance plcc (68 pin) q ja 50 c/w f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required electrical speci?cations general release specification mc68HC05V12 rev. 1.0 electrical specifications 17.5 power considerations the average chip junction temperature, t j , in c can be obtained from: (1) where: t a = ambient temperature in c q ja = package thermal resistance, junction to ambient in c/w p d = p int + p i / o p int = i cc v cc = chip internal power dissipation p i / o = power dissipation on input and output pins (user-determined) for most applications, p i / o p int and can be neglected. ignoring p i / o , the relationship between p d and t j is approximately: (2) solving equations (1) and (2) for k gives: (3) where k is a constant pertaining to the particular part. k can be determined from equation (3) by measuring p d (at equilibrium) for a known t a . using this value of k, the values of p d and t j can be obtained by solving equations (1) and (2) iteratively for any value of t a . t j t a p d q ja () + = p d k t j 273 c + ------------------------------ = p d t a 273 c + ()q ja p d () 2 + = f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
electrical specifications dc electrical characteristics mc68HC05V12 rev. 1.0 general release specification electrical specifications non-disclosure agreement required 17.6 dc electrical characteristics characteristic symbol min max unit output voltage i load = 10.0 m a i load = - 10.0 m a v ol v oh v dd - 0.1 0.1 v output high voltage (i load - 0.8 ma) port a, port b, port c, txp v oh v dd - 0.8 v output low voltage (i load = 1.6 ma) port a, port b, port c, txp v ol 0.4 v input high voltage port a, port b, port c port d, irq, reset, osc1, rxp v ih 0.7xv dd v dd v input low voltage port a, port b, port c, port d, irq, reset, osc1, rxp v il v ss 0.3 x v dd v supply current (see notes) run wait spi, timer, a/d, pwm, cop, lvr on wait above modules off stop lvr enabled lvr disabled i dd __ __ 10 6 4 300 200 ma ma ma m a m a i/o ports hi-z leakage current port a, port b, port c i oz 1 m a input current reset, irq, osc1, pd0-pd4 i in 1 m a capacitance (see note 9) ports (as input or output) reset, irq c out c int 12 8 pf low-voltage reset inhibit v lvri 3.5 4.2 v low-voltage reset recover v lvrr 3.6 4.5 v low-voltage reset inhibit/recover hysteresis h lv r 0.1 0.3 v v dd slew rate rising (see note 9) s vddr 0.1 v/ m s v dd slew rate falling (see note 9) s vddf 0.05 v/ m s notes: 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = C40 c to +85 c, unless otherwise noted. 2. all values shown reflect average measurements. 3. run (operating) i dd , wait i dd : measured using external square wave clock source to osc1 (f osc = 4.2 mhz), all inputs 0.2 vdc from rail; no dc loads, less than 50 pf on all outputs, c l = 20 pf on osc2. 4. wait, stop i dd : all ports configured as inputs, v il = 0.2 vdc, v ih = v dd C0.2 vdc. 5. stop i dd measured with osc1 = v ss . 6. wait i dd is affected linearly by the osc2 capacitance. 7. total 8. all coil drivers are set to the maximum current in automatic mode with no loading on the gauge pins. 9. not tested f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required electrical speci?cations general release specification mc68HC05V12 rev. 1.0 electrical specifications 17.7 control timing characteristic symbol min max unit frequency of operation crystal oscillator option external clock source f osc f osc 0.1 dc 4.2 4.2 mhz internal operating frequency crystal (f osc /2) external clock (f osc /2) f op f op dc 2.1 2.1 mhz cycle time (1/f op ) t cyc 476 ns crystal oscillator startup time (crystal oscillator option) t oxon 100 ms stop recovery startup time (crystal oscillator option) t ilch 100 ms reset pulse width low (see figure 5-2 ) t rl 120 ns interrupt pulse width low (edge-triggered) t ilih 120 ns interrupt pulse period t ilil see note 3 t cyc port c interrupt pulse width high (edge-triggered) t ilhi 120 ns port c interrupt pulse period t ihih see note 3 t cyc osc1 pulse width t osc1 90 ns eeprom programming time per byte t eepgm 10 ms eeprom erase time per byte t ebyt 10 ms eeprom erase time per block t eblock 10 ms eeprom bulk erase time t ebulk 10 ms eeprom programming voltage discharge period t fpv 10.0 m s rc oscillator stabilization time t rcon 5t cyc 16-bit timer resolution (see note 2) input capture pulse width input capture period t resl t th , t tl t tltl 4.0 85 see note 4 __ __ __ t cyc ns t cyc notes: 1. v dd = 5.0 vdc, v ss = 0 vdc, t a = C40 c to +85 c, unless otherwise noted. 2. the 2-bit timer prescaler is the limiting factor in determining timer resolution. 3. the minimum period, t ilil or t ihih, should not be less than the number of cycles it takes to execute the interrupt service routine plus 19 t cyc . 4. the minimum period, t tltl, should not be less than the number of cycles it takes to execute the capture interrupt service routine plus 24 t cyc . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
electrical specifications control timing mc68HC05V12 rev. 1.0 general release specification electrical specifications non-disclosure agreement required figure 17-1. stop recovery timing diagram 3ffe 3ffe 3ffe 3ffe 3fff 4 t rl t ilih osc1 1 reset irq 2 irq 3 internal clock internal address bus t ilch 4064 t cyc notes: 1. represents the internal gating of the osc1 pin. 2. irq pin is edge-sensitive mask option. 3. irq pin is level- and edge-sensitive mask option. 4. reset vector address is shown for timing example. reset or interrupt vector fetch f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required electrical speci?cations general release specification mc68HC05V12 rev. 1.0 electrical specifications 17.8 a/d converter characteristics characteristic min max unit comments resolution 8 8 bits absolute accuracy (v refl = 0.0 v, v refh = v dd ) +1 lsb include quantization conversion range v refh v refl v refl v refl - 0.1 v refh v dd v refh v v v a/d accuracy decreases proportionately as v refh is reduced below v cca min. (see note 3) power-up time 100 m s input leakage pd0Cpd4 v refl , v refh +1 +1 m a m a conversion time (includes sampling time) 32 32 t ad (see note 2) monotonicity inherent (within total error) zero input reading 00 01 hex v in = 0 v full-scale reading fe ff hex v in = v refh sample time 12 12 t ad (see note 2) input capacitance 8 pf not tested analog input voltage v refl v refh v a/d on current stabilization time (t adon ) 100 m s rc oscillator stabilization time (t rcon )5 m s notes: 1v cca = 5.0 10% vdc +10%, v ssa = 0.0 vdc, t a = - 40 c to +85 c, unless otherwise noted. 2. t ad = t cyc if clock source equals mcu. 3. not tested f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
electrical specifications lvr timing diagram mc68HC05V12 rev. 1.0 general release specification electrical specifications non-disclosure agreement required 17.9 lvr timing diagram figure 17-2. lvr timing diagram t vddf = v dd /s vddf t vddr = v dd /s vddr v lvri v lvrr v dd internal lvr reset pin f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required electrical speci?cations general release specification mc68HC05V12 rev. 1.0 electrical specifications 17.10 serial peripheral interface (spi) timing num characteristic symbol min max unit operating frequency master slave f op( m ) f op( s ) dc dc 0.5 4.2 f op mhz 1 cycle time master slave t cyc(m) t cyc(s) 2.0 240 t cyc ns 2 enable lead time master slave t lead(m) llead(s) see note 2 240 ns ns 3 enable lag time master slave t lag(m) t lag(s) see note 2 240 ns ns 4 clock (sck) high time master slave t w(sckh)m t w(sckh)s 340 190 ns ns 5 clock (sck) low time master slave t w(sckl)m t w(sckl)s 340 190 ns ns 6 data setup time (inputs) master slave t su (m) t su (s) 100 100 ns ns 7 data hold time (inputs) master slave t h (m) t h (s) 100 100 ns ns 8 access time (time to data active from high-impedance state) slave t a 0 120 ns 9 disable time (hold time to high-impedance state) slave t dis 240 ns 10 data valid (after enable edge) (see note 3) t v (s) 240 ns 11 data hold time (output) (after enable edge) t ho 0ns 12 rise time (20% v dd to 70% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss) t rm t rs 100 2.0 ns m s 13 fall time (20% v dd to 70% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss) t fm t fs 100 2.0 ns m s notes: 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h 2. signal production depends on software. 3. assumes 200 pf load on all spi pins f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
electrical specifications serial peripheral interface (spi) timing mc68HC05V12 rev. 1.0 general release specification electrical specifications non-disclosure agreement required figure 17-3. spi slave timing (cpha = 0) figure 17-4. spi slave timing (cpha = 1) 4 1 12 5 5 13 13 4 bit 6 --- 1 slave lsb out slave msb out see note note: not defined, but normally lsb of character previously transmitted. ss (input) sck (cpol = 0) (input) sck (cpol + 1) (input) miso (output) mosi (input) 7 6 8 9 2 2 11 10 lsb in msb in bit 6 --- 1 12 11 4 1 12 5 5 13 12 13 4 bit 6 --- 1 slave msb out slave lsb out see note note: not defined but normally lsb of character previously transmitted. ss (input) sck (cpol = 0) (input) sck (cpo l = 1) (input) miso (output) mosi (input) 7 6 10 8 2 3 9 11 10 lsb in msb in bit 6 --- 1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required electrical speci?cations general release specification mc68HC05V12 rev. 1.0 electrical specifications 17.11 gauge driver electricals characteristic symbol min max unit input current on v gsup with no coil current input current on v gsup with coil current (see note 3) input current on v gsup in stop mode i gsup 5 135 40 ma ma m a maximum reference current i max 0.47 0.57 ma internal total series impedance r si 20 60 w manual scan cycle period t msn 12 * t gcs 20 ms coil inductance (see note 4) l coil 31mh coil resistance (see note 4) r coil 140 270 w error tolerance of r max e max 1% coil current matching error (as % of i cm )e cm 0 1% coil current absolute error e ca 0 9% coil current update time t gcs tbd 1.67 ms coil current maximum i cm 23ma gauge supply regular error e gs 5% monotonicity see note 5 coil current step size i step (i cm /255) * 0.50 (i cm /255) * 1.50 ma notes: 1. v gsup = 7.6 vdc, t a = - 40 c to +85 c, unless otherwise noted. 2. minimum/maximum is dependent upon power calculation. 3. assumes sin/cos 4. coil is not on chip; values stated are indicative of the intended application. 5. inherent within total error. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
electrical specifications bdlc electricals mc68HC05V12 rev. 1.0 general release specification electrical specifications non-disclosure agreement required 17.12 bdlc electricals 17.12.1 transmitter vpw symbol timings 17.12.2 receiver vpw symbol timings note: the receiver symbol timing boundaries are subject to an uncertainty of 1 t bdlc m s due to sampling considerations. table 17-1. bdlc transmitter vpw symbol timings (bard bits bo[3:0] = 0111) characteristic number symbol min typ max unit passive logic 0 10 t tvp 1 62 64 66 m s passive logic 1 11 t tvp 2 126 128 130 m s active logic 0 12 t tva 1 126 128 130 m s active logic 1 13 t tva 2 62 64 66 m s start of frame (sof) 14 t tva 3 198 200 202 m s end of data (eod) 15 t tvp 3 198 200 202 m s end of frame (eof) 16 t tv 4 278 280 282 m s inter-frame separator (ifs) 17 t tv 6 298 300 302 m s note: f bdlc = 1.048576 mhz or 1.0 mhz table 17-2. bdlc receiver vpw symbol timings (bard bits bo[3:0] = 0111) characteristic number symbol min typ max unit passive logic 0 10 t trvp 1 34 64 96 m s passive logic 1 11 t trvp 2 96 128 163 m s active logic 0 12 t trva 1 96 128 163 m s active logic 1 13 t trva 2 34 64 96 m s start of frame (sof) 14 t trva 3 163 200 239 m s end of data (eod) 15 t trvp 3 163 200 239 m s end of frame (eof) 16 t trv 4 239 280 320 m s break 18 t trv 6 239 m s note: f bdlc = 1.048576 mhz or 1.0 mhz f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required electrical speci?cations general release specification mc68HC05V12 rev. 1.0 electrical specifications figure 17-5. bdlc variable pulse width modulation (vpw) symbol timings 13 11 10 12 16 14 sof 15 18 0 0 1 1 eod brk 0 eof f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification mechanical specifications non-disclosure agreement required general release specification mc68HC05V12 section 18. mechanical specifications 18.1 contents 18.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .233 18.3 68-lead plastic leaded chip carrier (plcc). . . . . . . . . . . . .234 18.2 introduction this section describes the dimensions of the dual in-line package (dip), plastic shrink dual in-line package (sdip), plastic leaded chip carrier (plcc), and quad ?at pack (qfp) mcu packages. package dimensions available at the time of this publication are provided in this section. to make sure that you have the latest case outline specifications, contact one of the following: ? local motorola sales office ? motorola mfax C phone 602-244-6609 C email rmfax0@email.sps.mot.com ? worldwide web (wwweb) at http://design-net.com follow mfax or wwweb on-line instructions to retrieve the current mechanical specifications. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required mechanical speci?cations general release specification mc68HC05V12 rev. 1.0 mechanical specifications 18.3 68-lead plastic leaded chip carrier (plcc) figure 18-1. 68-lead plcc, case 779-02 notes: 1. datums l, m, and n determined where top of lead shoulder exits plastic body at mold parting line. 2. dimension g1, true position to be measured at datum t, seating plane. 3. dimensions r and u do not include mold flash. allowable mold flash is 0.010 per side. 4. dimensioning and tolerancing per ansi y14.5m, 1982. 5. controlling dimension: inch. 6. the package top may be smaller than the package bottom by up to 0.012. dimensions r and u are determined at the outermost extremes of the plastic body exclusive of mold flash, tie bar burrs, gate burrs and interlead flash, but including any mismatch between the top and bottom of the plastic body. 7. dimension h does not include dambar protrusion or intrusion. the dambar protrusion(s) shall not cause the h dimension to be greater than 0.037. the dambar intrusion(s) shall not cause the h dimension to be smaller than 0.025. n l m brk y w v d d 68 1 a r g g1 e j view s c z s lm m 0.007 n s t 0.004 t seating plane x z g1 view dd u b dim min max inches a 0.985 0.995 b 0.985 0.995 c 0.165 0.180 e 0.090 0.110 f 0.013 0.019 g 0.050 bsc h 0.026 0.032 j 0.020 k 0.025 r 0.950 0.956 u 0.950 0.956 v 0.042 0.048 w 0.042 0.048 x 0.042 0.056 y 0.020 z 2 10 g1 0.910 0.930 k1 0.040  k1 k f h view s s lm m 0.007 n s t s lm s 0.010 n s t s lm m 0.007 n s t s lm m 0.007 n s t s lm m 0.007 n s t s lm m 0.007 n s t s lm s 0.010 n s t f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
mc68HC05V12 rev. 1.0 general release specification ordering information non-disclosure agreement required general release specification mc68HC05V12 section 19. ordering information 19.1 contents 19.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235 19.3 mcu ordering forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235 19.4 application program media. . . . . . . . . . . . . . . . . . . . . . . . . . .236 19.5 rom program verification . . . . . . . . . . . . . . . . . . . . . . . . . . .237 19.6 rom verification units (rvus). . . . . . . . . . . . . . . . . . . . . . . .238 19.7 mc order number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .238 19.2 introduction this section contains ordering information. 19.3 mcu ordering forms to initiate an order for a rom-based mcu, first obtain the current ordering form for the mcu from a motorola representative. submit the following items when ordering mcus: ? a current mcu ordering form that is completely filled out (contact your motorola sales office for assistance.) ? a copy of the customer specification if the customer specification deviates from the motorola specification for the mcu ? customers application program on one of the media listed in 19.4 application program media f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required ordering information general release specification mc68HC05V12 rev. 1.0 ordering information the current mcu ordering form is also available through the motorola freeware bulletin board service (bbs). the telephone number is (512) 891-free. after making the connection, type bbs in lowercase letters. then press the return key to start the bbs software. 19.4 application program media please deliver the application program to motorola in one of the following media: ? macintosh ?1 3-1/2-inch diskette (double-sided 800 k or double-sided high-density 1.4 m) ? ms-dos ?2 or pc-dos tm 3 3-1/2-inch diskette (double-sided 720 k or double-sided high-density 1.44 m) ? ms-dos ? or pc-dos tm 5-1/4-inch diskette (double-sided double-density 360 k or double-sided high-density 1.2 m) use positive logic for data and addresses. when submitting the application program on a diskette, clearly label the diskette with the following information: ? customer name ? customer part number ? project or product name ? file name of object code ? date ? name of operating system that formatted diskette ? formatted capacity of diskette on diskettes, the application program must be in motorolas s-record format (s1 and s9 records), a character-based object file format generated by m6805 cross assemblers and linkers. 1. macintosh is a registered trademark of apple computer, inc. 2. ms-dos is a registered trademark of microsoft corporation. 3. pc-dos is a trademark of international business machines corporation. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
ordering information rom program verification mc68HC05V12 rev. 1.0 general release specification ordering information non-disclosure agreement required note: begin the application program at the first user rom location. program addresses must correspond exactly to the available on-chip user rom addresses as shown in the memory map. write $00 in all non-user rom locations or leave all non-user rom locations blank. refer to the current mcu ordering form for additional requirements. motorola may request pattern re-submission if non-user areas contain any non-zero code. if the memory map has two user rom areas with the same addresses, then write the two areas in separate files on the diskette. label the diskette with both filenames. in addition to the object code, a file containing the source code can be included. motorola keeps this code confidential and uses it only to expedite rom pattern generation in case of any difficulty with the object code. label the diskette with the filename of the source code. 19.5 rom program verification the primary use for the on-chip rom is to hold the customers application program. the customer develops and debugs the application program and then submits the mcu order along with the application program. motorola inputs the customers application program code into a computer program that generates a listing verify file. the listing verify file represents the memory map of the mcu. the listing verify file contains the user rom code and may also contain non-user rom code, such as self-check code. motorola sends the customer a computer printout of the listing verify file along with a listing verify form. to aid the customer in checking the listing verify file, motorola will program the listing verify file into customer-supplied blank preformatted macintosh or dos disks. all original pattern media are filed for contractual purposes and are not returned. check the listing verify file thoroughly, then complete and sign the listing verify form and return the listing verify form to motorola. the signed listing verify form constitutes the contractual agreement for the creation of the custom mask. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
non-disclosure agreement required ordering information general release specification mc68HC05V12 rev. 1.0 ordering information 19.6 rom verification units (rvus) after receiving the signed listing verify form, motorola manufactures a custom photographic mask. the mask contains the customers application program and is used to process silicon wafers. the application program cannot be changed after the manufacture of the mask begins. motorola then produces ten mcus, called rvus, and sends the rvus to the customer. rvus are usually packaged in unmarked ceramic and tested to 5 vdc at room temperature. rvus are not tested to environmental extremes because their sole purpose is to demonstrate that the customers user rom pattern was properly implemented. the ten rvus are free of charge with the minimum order quantity. these units are not to be used for qualification or production. rvus are not guaranteed by motorola quality assurance. 19.7 mc order number table 19-1 shows the mc order number for the available package type. table 19-1. mc order number package type temperature range order number 68-lead plastic leaded chip carrier (plcc) C40 c to 85 ? c mc68HC05V12cfn notes: 1. fn = plastic-leaded chip carrier (plcc) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006
hc05v12grs/d f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . . archived by freescale semiconductor, inc. 2006


▲Up To Search▲   

 
Price & Availability of 68HC05V12

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X